[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date index
][
Thread index
]
st: creating lag variables
From
Reka Sundaram-Stukel <
[email protected]
>
To
[email protected]
Subject
st: creating lag variables
Date
Mon, 5 May 2003 00:27:14 -0500
Dear Statalist,
I am trying to create a lag y for data that looks like the following:
id type choice Year lag_choice
1 a 1 1 -
1 b 0 1 -
1 c 0 1 -
1 d 0 1 -
1 a 0 2 1
1 b 0 2 0
1 c 1 2 0
1 d 0 2 0
how do I generate lag_choice. I have tried
by id type: gen lag_choice=choice[_n-1] and various combinations of this quite unsuccessfully. Help please
Thanks in advance
Reka
Reka Sundaram-Stukel
Graduate student
320 Taylor Hall
Department of Agriculture And Applied Economics
Madison, WI-53706
*
* 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/
Follow-Ups
:
Re: st: creating lag variables
From:
"Oleksandr Talavera, BC" <
[email protected]
>
Prev by Date:
st: "Floating Point Overflow"
Next by Date:
Re: st: creating lag variables
Previous by thread:
st: "Maximum line width (4096) exceeded in ASCII file"
Next by thread:
Re: st: creating lag variables
Index(es):
Date
Thread
© Copyright 1996–2024 StataCorp LLC |
Terms of use
|
Privacy
|
Contact us
|
What's new
|
Site index