Statalist The Stata Listserver


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

st: RE: change value an old variable


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: RE: change value an old variable
Date   Mon, 4 Dec 2006 09:14:01 -0600

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/



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