Statalist The Stata Listserver


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

RE: st: RE: change value an old variable


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: change value an old variable
Date   Mon, 4 Dec 2006 15:34:23 -0000

Only if your panel starts in year 1 (1 CE = 1 AD). 

Nick 
[email protected] 

[email protected]

> thanks a lot
> I try to do this:
> by sort id country: replace var=var[_n+1] if year==1
> 
> is it the same?
> 
> now try with your help.
> best
> 
> Quoting Scott Merryman <[email protected]>:
> 
> > 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