Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Identify 1st observation in each group in a panel data model


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: Identify 1st observation in each group in a panel data model
Date   Mon, 11 Apr 2005 22:24:52 +0100

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/



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