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

From |
"Eva Poen" <eva.poen@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: How to tell a macro to use previous global value of that loop, akin to [_n-1] for columns |

Date |
Sun, 17 Aug 2008 14:06:37 +0100 |

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 <eva.poen@gmail.com>: > 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/

**Follow-Ups**:**Re: st: How to tell a macro to use previous global value of that loop, akin to [_n-1] for columns***From:*"Jared Fotis" <kingjared@gmail.com>

**References**:**st: How to tell a macro to use previous global value of that loop, akin to [_n-1] for columns***From:*"Jared Fotis" <kingjared@gmail.com>

**Re: st: How to tell a macro to use previous global value of that loop, akin to [_n-1] for columns***From:*"Eva Poen" <eva.poen@gmail.com>

- Prev by Date:
**Re: st: How to tell a macro to use previous global value of that loop, akin to [_n-1] for columns** - Next by Date:
**Re: st: How to tell a macro to use previous global value of that loop, akin to [_n-1] for columns** - Previous by thread:
**Re: st: How to tell a macro to use previous global value of that loop, akin to [_n-1] for columns** - Next by thread:
**Re: st: How to tell a macro to use previous global value of that loop, akin to [_n-1] for columns** - Index(es):

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