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/