Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: Creating a variable which collects info on other members |
Date | Sat, 7 May 2011 16:10:08 +0100 |
Namely, 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 Assuming householdid is_head is_marriedtohead bysort householdid : egen spousestuff = total(stuff * is_married_to_head) etc. Techniques in this territory are discussed in my Speaking Stata column in SJ 11(2), due out about June. Nick On Sat, May 7, 2011 at 1:26 PM, Nick Cox <njcoxstata@gmail.com> wrote: > This is an FAQ. -search members, FAQ- in Stata. > On 7 May 2011, at 13:13, Vincenzo Carrieri <vincenzo.carrieri@gmail.com> >> I need to create a variable which collects the information on another >> household member. >> In particular, I have a variable weight (var name) for each individual >> and a dummy variable which is equal to one if the person is married >> with the head of household (the head of household is identified by a >> dummy variable relpar (var name) which is equals to one when the >> person is head of houseold). >> >> I need to create a variable that for each head of household collects >> the weight of his wife (or husband). >> How can I do this on stata? * * 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/