bysort id (year):replace var = var[2] if _n == 1 & mi(var)
Scott
> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of [email protected]
> Sent: Monday, December 04, 2006 8:27 AM
> To: [email protected]
> Subject: st: change value an old variable
>
> Dear All,
> I have a variable in a panel that in first year is missing for each
> value. I want to swap this variable by the value of the variable in
> second year? How do it in stata? i try with generate and replace but
> not function.
> Thanks a lot for your help
> Catia
>
*
* 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/