Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: How to detect the change of i over t?


From   Benson Limann <[email protected]>
To   stata <[email protected]>
Subject   st: How to detect the change of i over t?
Date   Sat, 7 Feb 2009 21:46:46 -0700

Hi all:
 
I am using an unbalanced panel dataset. i is ID and t is time. Every (i,t) has a characteristic x=0 or 1. 
 
I want to generate a variable called "become" such that for each (i,t):
 
become=1, if x=0 at time t-1, and x=1 at time t
become=0, otherwise
 
How to write it? My primary concern is how to deal with the first t for each i--this observation does not have t-1.
 
Any suggestion would be greatly appreciated.
 
Ben

 
_________________________________________________________________
Windows Live™: E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t2_allup_howitworks_022009
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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