[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: creating a "years since event" variable in panel data
Hi,
I have a annual panel data set (1 obs per year), where ID identifies the
person and the variable OBSYEAR the year of observation (1995=1, 1996=2,
..., 2002=7).
The variable TIME is the time dimension, ranging from 0 to 7.
The variable EVENT is a dymmy (1=event happened during the year in question;
0=event did not happen during the year in question).
Q: How do I create the variable NUMBER OF YEARS SINCE (A POSSIBLE) CHANGE
FROM 0 to 1 on EVENT?
Best regards,
Christer Thrane
*
* 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/