Dirk writes
I want to do a panel regression where I have also a lag on the rhs of
the
equation, but trying
xtreg y l.y
doesn't work. also i cannot generate a lag variable. how should i do it?
As a followup suggests, you need to tsset your data.
xtreg works perfectly well with lags---in Stata 9. The Statalist FAQ
indicates that if you are using some older version of Stata, you
should say so in your post. Since xtreg did not support time series
operators in Stata 8 or earlier, I presume you are using Stata 8. In
that context,
tsset ... (as suggested)
gen double ly = L.y
xtreg y ly, fe
will work in older versions of Stata. In Stata 9, just use xtreg y
L.y, fe -- but tsset is required.