I should add that this solution does not cater for two or more
consecutive entries and exits by the same firm within the 10 year
timeframe. So, if cases like this one exist,
1 1 . . 1 1 1 1 . . (first exit in year 2, then re-entry in year 4
and exit in year 8)
only the last exit will be recorded.
Eva
2008/8/17 Eva Poen <[email protected]>:
> gen ExitYear = .
> forvalues X = 2/10 {
> replace ExitYear= `X'-1 if LHS_NMCE_`X'==. & LHS_NMCE_`=`X'-1'==1
> }
*
* 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/