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]
Re: st: creating variable for "any sibling"
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: creating variable for "any sibling"
Date
Fri, 1 Feb 2013 21:27:15 +0000
This may help:
FAQ . . Creating variables recording prop. of the other members of a group
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
4/05 How do I create variables summarizing for each
individual properties of the other members of a
group?
http://www.stata.com/support/faqs/data/members.html
Dilekdee <[email protected]> [edited]
> I have a household survey dataset 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.
*
* 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/