Announcement

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

  • Significant bug / error in how Stata runs regressions with fixed effects

    I believe I have found a major bug / error in how Stata runs regressions with fixed effects. The specific data I am using is confidential so I cannot share a sample of that but I will do my best to describe the situation as best as possible.

    I have a panel dataset and I am trying to run the following regression:

    xtreg y x1 x2 x3 i.year i.month

    The year variable represents the year and the month variable represents the month of the year (so it goes from 1 to 12). The only thing I care about is the coefficient of x1.

    The problem is that if I run the following regression:

    xtreg y x1 x2 x3 i.month i.year

    The coefficient of x1 changes. This does not make any sense to me and, as far as I know, this should not be happening. Does anyone have any feasible explanations as to what is going on? If not, how can I report this to Stata so that this problem may be fixed in future versions? For context, I am using Stata 17.


    Thanks!

  • #2
    If you've found a bug, then you should be able to give a reproducible example based on fake data or a publicly available dataset.

    Comment


    • #3
      I second what Nick said, and will also note that what you did post is not even running a FE model (xtreg runs random effects by default).

      Comment


      • #4
        I think you should also show the results you are obtaining. and some general explanation of what your variables are measuring, as well as the nature of them (time fixed? individual fixed? fully variable across time and individuals?)

        Things like this happen usually because of colinearity between variables. So the order of the covariates will affect which ones are dropped, and thus, the coefficients of the model.

        Comment

        Working...
        X