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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: creating variable for "any sibling"


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
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 <dilek.sayedahmed@mail.mcgill.ca> [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/


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