> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Dimitriy V. Masterov
> Sent: Friday, December 17, 2004 4:44 AM
> To: [email protected]
> Subject: Re: st: Re: programming advice
>
> I am not sure if I understand your problem correctly, but is this
> what you have in mind?
>
> gen x0=.
> bys code1: replace x0=x1 if month==0
> bys code1: replace x0=sum(x0)
>
>
Another way is:
bysort code (month): gen x0 = x1[1]
Scott
*
* 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/