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: creating variable for "any sibling"


From   Dilekdee <[email protected]>
To   [email protected]
Subject   st: creating variable for "any sibling"
Date   Fri, 1 Feb 2013 12:34:43 -0800 (PST)

Hello-

I have a household survey data and would like to construct a variable for
"any siblings" and "number of siblings". I have data for each household
member. In columns, I have relation to young adult 1 (YA1), relationship to
YA2, and relationship to YA3. For example, under relationship to YA1 column,
I have "self" and under relationship to YA1 (for the same household) I have
"brother/sister". I hope to create a variable that indicates "1" for the
young adult individual that reported "self" and "1" for the individual who
is the "brother/sister" of that young adult1. 

sort hhid
gen w1h_anysib=0
by hhid: replace w1h_anysib=1 if w1h_reltoya1 == 7

I get "1"s for the individuals who are brother or sister of YA1 however, the
YA1 him/herself does not have the "1" indicator. 

Any help would be greatly appreciated.
Thank you!
Best, 
Dilek





--
View this message in context: http://statalist.1588530.n2.nabble.com/creating-variable-for-any-sibling-tp7580306.html
Sent from the Statalist mailing list archive at Nabble.com.
*
*   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