Announcement

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

  • Year variables in panel data with first difference


    Hi dear fellows,

    I'm using fixed effect with panel data from 2011 to 2015 and my command is xtreg y x1 x2 i.year, fe. But it suffers serial correlation.One of the suggestions is that use First difference. Would the command be reg D.(Y x1 x2 year), nonconstant or reg D.(Y x1 x2 2011 2012 2013 2014 2015), nonconstant where 2011 indicates the dummy variable for year 2011.
    In addition, how is the command reg D.(Y x1 x2 year) different from the command xtreg D(Y x1 x2), fd?

    Thanks in advance.

  • #2
    I'm using fixed effect with panel data from 2011 to 2015 and my command is xtreg y x1 x2 i.year, fe. But it suffers serial correlation.
    You do not state how many observations you have, only that T=5. As long as you have a relatively large number of cross-sectional units (individuals/ firms/ countries), then you will be fine by just clustering your standard errors

    Code:
    xtreg y x1 x2 i.year, fe cluster(firm)
    One of the suggestions is that use First difference.
    FD regression is not a remedy for serial correlation. I would be interested in knowing where you got this idea from.

    reg D.(Y x1 x2 2011 2012 2013 2014 2015), nonconstant where 2011 indicates the dummy variable for year 2011.
    This is fine, except that you need to drop one of the year indicator variables and cluster your standard errors. The easiest way would be


    Code:
    xi: regress D.(Y x1 x2 i.year), nocons cluster(firm)

    xtreg D(Y x1 x2), fd
    This is not legal syntax in Stata. You can read here about the difference between including time dummies and a time trend (i.year vs. year) in a regression model



    Comment


    • #3
      Originally posted by Andrew Musau View Post

      You do not state how many observations you have, only that T=5. As long as you have a relatively large number of cross-sectional units (individuals/ firms/ countries), then you will be fine by just clustering your standard errors

      Code:
      xtreg y x1 x2 i.year, fe cluster(firm)


      FD regression is not a remedy for serial correlation. I would be interested in knowing where you got this idea from.



      This is fine, except that you need to drop one of the year indicator variables and cluster your standard errors. The easiest way would be


      Code:
      xi: regress D.(Y x1 x2 i.year), nocons cluster(firm)



      This is not legal syntax in Stata. You can read here about the difference between including time dummies and a time trend (i.year vs. year) in a regression model


      Thanks for the reply Andrew.

      My panel is 145 school districts with 7 years and I did cluster my standard errors at the school district level by running :
      Code:
      xtreg y x1 x2 i.year, fe cluster(school district)
      FD regression is not a remedy for serial correlation? My adviser told me to use FD for robustness check because when I run
      Code:
      xtserial: Y x1 x2
      I get 0.01 which reject the null that there is no serial correlation. So the data suffers serial correlation and what your suggestions on this would be?

      Additionally, I know when t=2, FD and FE produce the same results but some coefficients change in significance and sign when I switch from FE to FD. Any thoughts?

      Thank you very much.

      Comment


      • #4
        My panel is 145 school districts with 7 years and I did cluster my standard errors at the school district level by running
        Don't bother with the test for serial correlation. Just cluster at the school district level and your standard errors will be robust to serial correlation.

        FD regression is not a remedy for serial correlation? My adviser told me to use FD for robustness check because when I run
        "Robust" here has nothing to do with serial correlation. What your adviser wants to see is whether inferences change if you switch from FE to FD. If they do, your results are not robust and vice-versa. At the moment, you present no results so I cannot comment in more detail. However, you should look as to whether the coefficients of the main variables have the same sign and whether they remain significant. If you need further commentary, post the results of both

        Code:
         
         xtreg y x1 x2 i.year, fe cluster(school district)    
         xi: reg D.(y x1 x2 i.year), cluster(school district)
        Finally, there is no need to quote the entire post (as you do in #2) because your reply follows directly below it. If you want to reply to some part of it, you can copy the text and wrap quote tags around it as I do above.

        Comment

        Working...
        X