Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: xtreg with lag


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: xtreg with lag
Date   Tue, 18 Oct 2005 08:28:45 -0400

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.

Kit

Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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