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 a variable which collects info on other members
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
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 <[email protected]> wrote:
> This is an FAQ. -search members, FAQ- in Stata.
> On 7 May 2011, at 13:13, Vincenzo Carrieri <[email protected]>
>> 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/