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]

st: recoding missing value on variable with nonmissing value on variable within groups


From   Erik Aadland <erikaadland@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: recoding missing value on variable with nonmissing value on variable within groups
Date   Wed, 20 Jun 2012 10:45:51 +0000

Dear statalist.
 
I am trying to recode the missing values on "jury_id" in example below with the nonmissing values for jury_id by yearmonth.
Unfortunately, the "by" command is not allowed with the recode command.
 
yearmonth    jury_id    WANTED RESULT
1            1          1
1            1          1
1            1          1
1            .          1
2            2          2
2            2          2
2            2          2 
2            2          2
3            2          2
3            .          2
3            .          2
4            3          3
4            3          3

 
Any input on this problem would be very much appreciated.
 
Regards,
 
Erik.
 
  		 	   		  
*
*   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