Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Measuring Relative Time (wrt an Event)
From
Dana Shills <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Measuring Relative Time (wrt an Event)
Date
Fri, 20 Sep 2013 14:43:13 -0400
I have an unbalanced panel dataset and I want a variable that shows the time to an event happening. Here is how the data looks. Is there a neat way of creating the "Relative Time" variable without a huge code?
Panel ID Year Event RelativeTime
A 1996 0 t-4
A 1998 0 t-2
A 1999 0 t-1
A 2000 1 t
A 2004 0 t+4
A 2005 0 t+5
B 1999 0 t-6
B 2000 0 t-5
B 2001 0 t-4
B 2003 0 t-2
B 2005 1 t
B 2006 0 t+1
Thanks
Dana
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/