Bookmark and Share

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   Michael Riechert <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Problem creating lag variable in panel data
Date   Tue, 17 Dec 2013 19:14:10 +0000

Fernando, 
Many thanks! This is actually a quite simple solution and I already asking myself how stupid I´ve been overlooking that. Thanks for your fast response.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Fernando Rios Avila
Sent: Dienstag, 17. Dezember 2013 20:10
To: [email protected]
Subject: Re: st: Problem creating lag variable in panel data

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/

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index