Thanks Nick; I often forget this construction.
Scott
> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Nick Cox
> Sent: Monday, April 11, 2005 4:25 PM
> To: [email protected]
> Subject: st: RE: RE: Identify 1st observation in each group in a panel
> data model
>
> This code can be condensed to
>
> bysort code (year): gen DV = _n == 1
>
> Nick
> [email protected]
>
> Scott Merryman
>
> > How about this:
> >
> > gen DV = 0
> > bysort code (year): replace DV = 1 if _n == 1
> >
>
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/