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, is already up and running.

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

st: creating variable for "any sibling"

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


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!

View this message in context:
Sent from the Statalist mailing list archive at
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index