Announcement

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

  • How to Adjust Standard Errors for time-series correlation and cross-sectional dependence.

    I have a large dataset currently set up as a panel, (1000 Firms and 200 Months). I would like to run a fixed-effect panel regression and adjust standard errors for both cross-sectional and time series correlation as my data suffers from both issues.

    First, I tried - cluster(ID) - but it seems to only correct for time-series autocorrelation. Then I clustered by(ID) and added a time dummy, but my R-Squared increased dramatically.

    I was wondering if it is possible to cluster by both ID and Time? Also, why is the R-Squared increase significantly when I include a time-dummy?



    Your help is much appreciated as I am a beginner Stata user.

  • #2
    Please first "ssc install reghdfe", and then "help reghdfe". The -reghdfe- command can account for both issues you encountered. For instance,
    Code:
    webuse nlswork, clear
    
    reghdfe ln_w grade age ttl_exp tenure not_smsa south , absorb(idcode year)
    
    // cluster at both dimensions
    reghdfe ln_w grade age ttl_exp tenure not_smsa south , absorb(idcode year) vce(cluster idcode year)
    Ho-Chuan (River) Huang
    Stata 19.0, MP(4)

    Comment


    • #3
      River Huang Thank you very much.

      Comment


      • #4
        Dear Karl Lamber,

        You may also want to check the Driscoll-Kraay standard errors computed by -xtscc-

        Best wishes,

        Joao

        Comment


        • #5
          Will clustering on the fixed and time effects account for serial correlation in the same manner as xtscc accounts for it?

          Comment

          Working...
          X