Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Problem creating lag variable in panel data
From 
 
Fernando Rios Avila <[email protected]> 
To 
 
[email protected] 
Subject 
 
Re: st: Problem creating lag variable in panel data 
Date 
 
Tue, 17 Dec 2013 14:09:50 -0500 
Hi Michael,
That is a miss understanding.
The right way to get the 1 year lag is:
gen lroi=l.roi
(lower case L)
what you are doing is a handy way to create dummies.
HTH
Fernando
On Tue, Dec 17, 2013 at 2:02 PM, Michael Riechert
<[email protected]> wrote:
> Dear all,
>
> I still facing problem while creating a lag variable within my panel data. I have
> multiple cross sectional units (companies) and years. I used xtset to define
> panel structure and then  gen roi1=1.roi to create a 1-year lag variable
> of the original variable roi. But the new variable only contains zeros. The
> same is true for other variables. I am sure I did something wrong but have no
> clue so far what it is. I appreciate every hint you will give me. Thank you!
>
> Best regards,
> Michael
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/