Re: Constructing # of Sibling and HHmember rank Variables [message #9681 is a reply to message #9654] |
Thu, 05 May 2016 19:39 |
abukhatwa
Messages: 2 Registered: November 2015 Location: Worcester, MA
|
Member |
|
|
Thank you Bridgette! This is very helpful!
I am trying to generate number of siblings for household members using household member recode,I understood that the commands you sent me are to generate number of siblings for a child under 5, since b16 indicates the child's line number. Am I correct?
The way I thought of this is: follow the same steps with few adjustments, I generated a son/daughter variable=1 if hv101==3 (head's son/ daughter) and =0 otherwise.
generate sonORdaughter=0
replace sonORdaughter=1 if hv101==3
then I followed the steps you sent me
use PooledDataHHMem99-12
sort hv001 hv002 sonORdaughter
save PooledDataHHMem99-12, replace
gen sibs_in_hh=1
collapse (sum) sibs_in_hh, by ( hv001 hv002 sonORdaughter)
replace sibs_in_hh=sibs_in_hh-3
*sibs_in_hh-3 (hv101 head=1 wife/husband=2)
replace sibs_in_hh=0 if sibs_in_hh<0
tab sibs_in_hh, m
merge hv001 hv002 sonORdaughter using PooledDataHHMem99-12
tab _merge
tab sibs_in_hh, m
drop _merge
Does this look right?
I also wanted to generate an oldest child and youngest child variable. To generate the oldest child I ran:
gen son_daug_order=0
replace son_daug_order=hvidx-2 if sonORdaughter==1
gen oldest=1
replace oldest=2 if son_daug_order==1
Is this right? If yes, how can I generate youngest child variable?
Your help is greatly appreciated!
Thank you,
Abir
A
[Updated on: Sun, 08 May 2016 12:50] Report message to a moderator
|
|
|