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: repeating first x values


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: repeating first x values
Date   Mon, 12 Sep 2011 17:04:19 +0100

bysort id (alpha) : replace alpha = alpha[1]

will work with your example. See also

FAQ     . . . . . . . . . . . . . . . . . . . . . . . Replacing missing values
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
        2/03    How can I replace missing values with previous or
                following nonmissing values?
                http://www.stata.com/support/faqs/data/missing.html


2011/9/12 Gabriel Nicolás Michelena <[email protected]>:

> I will be specifc. I have this dataset
>
>  alpha    id    id2
> .00474     1     1
> .00062     2     1
> .035085    3     1
> .035085    4     1
> .035665    5     1
>   .       1     2
>   .       2     2
>   .       3     2
>   .       4     2
>   .       5     2
>
>
> and i want to replace the missing values in alpha (in id2=2) repeating the values of variable alpha in id=1
>
> some clue how can i do it?
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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