Announcement

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

  • Understanding the use of if command in fixed effect in Stata

    I recently saw a comment on fixed effect panel regression on a panel data with N>T. The code is specfied for instance as

    Xtreg GDP infla govt_spend exch if Id≤3, Fe vce(cluster Id)
    .
    I understand that we usually use cluster robust When we have some issues with autocorrelation.
    I want to understand why the author used the if statement with id≤3. When the cross sectional unit of the data is more than 3. In addition, I hope I am also right with my understanding of clustered vce.
    I am asking this because I tried to use this approach in my fixed effect analysis and my within variation increased from 33% to 68%. Which seems to be a better model considering the fact that I'm using fixed effect estimate. Although, the coefficients now becomes higher than when I didn't include the "if " statement.

  • #2
    All one can really conclude from this is that the author wanted to restrict estimation using the if qualifier (not command) to the first 3 id values. I wouldn’t blindly copy the code without fully understanding what it does and only the author can clarify that point.

    Comment


    • #3
      This strikes me as peculiar. If the ID runs from 1, 2, 3, 4 and so on, only the first three cross-sectional units would be used. That’s N = 3, with unknown T. No way you should cluster in that case. In fact, one shouldn’t attempt inference at all using standard panel data estimators.

      Comment

      Working...
      X