Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: replace missing values in different waves


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: RE: replace missing values in different waves
Date   Wed, 26 Dec 2012 11:12:03 +0000

bysort personnumber (Gender) : replace Gender = Gender[1]

would suffice here.

See also

http://www.stata.com/support/faqs/data-management/replacing-missing-values/

Using -search missing- in Stata would have pointed you to this documentation.

Nick

On Wed, Dec 26, 2012 at 2:51 AM,  <[email protected]> wrote:

> my dataset looks like this:
>
>
> personnumber    Gender   different other variables
> 100             1
> 100             .
> 100             .
> 101             2
> 101             2
> 101             .
> 102             2
> 102             .
> 102             .
>
> for each person i have 3 waves in the dataset. now i want to replace the missing values (.) in with the value of the first wave. (e.g. 1 for person 100, 2 for person 101, 2 for person 3).
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index