Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: A coding question


From   Joerg Luedicke <joerg.luedicke@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: A coding question
Date   Wed, 28 Mar 2012 09:41:07 -0700

I would create a new variable (preserving original information):

egen var2=max(var1), by(year)

J.

On Wed, Mar 28, 2012 at 9:32 AM, Rituparna Basu <basur@pamfri.org> wrote:
> Dear STATAlist,
>
> I have a variable which looks like:
> var 1  year
> 1      07
> .      07
> .      07
> 1      07
> .      08
> .      08
> .      08
>
> But I want to make it look like this:
>
> var 1  year
> 1      07
> 1      07
> 1      07
> 1      07
> .      08
> .      08
> .      08
>
>
> Could you suggest how to do it? I have tried different ways but does not seem to work.
>
> Thank you in advance!
>
> Regards,
>
> RB
>
>
> *
> *   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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index