Announcement

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

  • Xttest2 in a non panel data regression?

    I tried to perform a xttest2, and this was the output:

    Error: too few common observations across panel.
    no observations

    I have about 20 observations for each year (for 4 years).

    So I performed a reg controlling for the time variable and using robust estimator. I need to test if the errors are correlated,

    Any help?

  • #2
    Gusta:
    welcome to this forum.
    I'm not clear with your using -regress- with panel data.
    That said, after -xtreg,fe- you can investigate the serial correlation of the idisyncratic error via the following approach, that draws heavily on: https://www.stata.com/bookstore/micr...metrics-stata/, pages 252-253:
    Code:
    use "http://www.stata-press.com/data/r15/nlswork.dta"
    quietly xtreg ln_wage age, fe
    predict idiosyncratic_error, e
    forvalues i = 1/15  {
    quietly corr idiosyncratic_error L`i'.idiosyncratic_error
    display "Autocorrelation at lag `i' = "%6.3f r(rho)
    }
    Autocorrelation at lag 1 =  0.298
    Autocorrelation at lag 2 =  0.173
    Autocorrelation at lag 3 =  0.044
    Autocorrelation at lag 4 = -0.045
    Autocorrelation at lag 5 = -0.107
    Autocorrelation at lag 6 = -0.188
    Autocorrelation at lag 7 = -0.201
    Autocorrelation at lag 8 = -0.287
    Autocorrelation at lag 9 = -0.296
    Autocorrelation at lag 10 = -0.309
    Autocorrelation at lag 11 = -0.322
    Autocorrelation at lag 12 = -0.357
    Autocorrelation at lag 13 = -0.349
    Autocorrelation at lag 14 = -0.404
    Autocorrelation at lag 15 = -0.352
    
    .
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment

    Working...
    X