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

Re: RE: st: creating lag variables (corrected)


From   REKA SUNDARAM-STUKEL <[email protected]>
To   [email protected]
Subject   Re: RE: st: creating lag variables (corrected)
Date   Mon, 05 May 2003 07:30:09 -0600

Nick,

I typed the following:

bysort id type: gen lag_choice=choice[_n-1] 

Could you please explain why 'year' needs to be in 
parenthesis. Thank you.

Reka
----- Original Message -----
From: Nick Cox <[email protected]>
Date: Monday, May 5, 2003 8:11 am
Subject: RE: st: creating lag variables (corrected)

> REKA SUNDARAM-STUKEL
> 
> > Thanks to both Nick and Oleksandr. In reply to Nick's 
> > question I am not sure why it doesn't work. 
> 
> What did you type? Can you remember or 
> retrieve it from a log file?
> 
> One possibility is that 
> 
> . bysort id type (year) : ... 
> 
> is guaranteed to get -year- in the 
> desired order, whereas 
> 
> . bysort id type : ... 
> 
> is not so guaranteed. 
> 
> Nick 
> [email protected] 
> 
> *
> *   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/
> 

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