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]

st: new var from an old one if a third var has a certain value


From   Caterina Astarita <[email protected]>
To   [email protected]
Subject   st: new var from an old one if a third var has a certain value
Date   Mon, 24 Jan 2011 18:28:41 +0000 (GMT)

Dear statlister, 

I need to generate a new variable that have the values of an 
old one if a third variable has a certain value, othewise a 
missing value. 

Let's say we have two variables var1 and var2, I would like to 
generate a var3 that has the value of var1 but only if var2 
has a certain value otherwise not. 

Can you suggest some command? 

Thank you 

Caterina
*
*   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