Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using xi in regress vs. xtreg

    Hi,

    I'm running a series of regressions. The basic version is it the form of:
    xi: regress y x1 x2 ... x30 i.year i.industry, cluster(ticker)
    where ticker is a company's stock ticker (the data has measurements from multiple firms across time).

    Now, I also wanted to do a random-effects and fixed-effects version and, based on the help function, I tried the following:
    xi: xtreg y x1 x2 ... x30 i.year i.industry, re cluster(ticker)

    However, I get the following error:
    "i() required" (same error for the fe version)

    What am I missing?

  • #2
    first, unless you have a quite old version of Stata, do not use "xi" - instead use factor variable notation; see -h fvvarlist-

    second, you have apparently not xtset your data (see -h xtset-); Stata needs a way to recognize panels and this can generally be done either by -xtset- used once or for each estimate by using the "i()" option to tell Stata what the panel identifier is

    Comment


    • #3
      Originally posted by Rich Goldstein View Post
      first, unless you have a quite old version of Stata, do not use "xi" - instead use factor variable notation; see -h fvvarlist-

      second, you have apparently not xtset your data (see -h xtset-); Stata needs a way to recognize panels and this can generally be done either by -xtset- used once or for each estimate by using the "i()" option to tell Stata what the panel identifier is
      Thanks for the reply.

      I run 9.2 and given that the fvvarlist command doesn't show up in the help window, it's not available.

      As far as xtset is concerned, when I have multiple firm measurements over multiple years, would "xtset firm year, yearly" be the correct command? How does this affect the usage of the regression functions specified above?

      Comment

      Working...
      X