Hi Statalist,
I wanted to generate a duration variable to determine, how long a firm remained in a specific state. the dataset is panel where T>N. The change in state of the firm is explained by a dummy variable. The duration variable as shown below capture duration of each spell. I thought of using -xi i.d- but it generate the same variable as -d-.
iddate2dDuration
11658711
11661712
11664613
11667900
11670911
11674000
11677011
11680000
11683211
11686000
11689111
Any help will be highly appreciated.
Regards
David
*
* 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/