[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: autocorrelation in panel data

From   Rufus Peabody <>
Subject   st: autocorrelation in panel data
Date   Tue, 19 Aug 2008 00:54:38 -0700

Hi all,

I'm dealing with data where I'm trying to predict a variable based on previous values of that variable. I have an unbalanced panel. I have no problems getting the coefficient for each lag of the variable:

(data is already tsset with a panel variable and time variable)

foreach v of local vars {
regress `v' L(1/10).`v' LY_`v'_norm LY_`v'_norm_intobs if L10.year==year

, where `v' is the variable, LY_`v'_norm is the normalized average of the variable for the particular panel during the previous year & LY_`v'_norm_intobs is an interaction of LY_`v'_norm and the number of observations for that panel the previous year. (Since there is a lot of luck inherent in the variable in a short-run period, I'm including these so I can "regress to the mean" the variable as appropriate.

While the results of this regression are not problematic (shown below), I would like a way to fit a curve which takes out all the noise from including a bunch of lags. - corrgram - does not seem to work with panel data. I should point out that there are no fixed effects. I would like to fit a decay function that I can apply to all panels.

* For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index