Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: creating a "years since event" variable in panel data


From   Christer Thrane <[email protected]>
To   [email protected]
Subject   st: creating a "years since event" variable in panel data
Date   Thu, 08 Mar 2007 19:23:04 +0100

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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index