Re: Food security- South Africa DHS 2016 [message #21975 is a reply to message #21901] |
Tue, 12 January 2021 12:27 |
Shireen-DHS
Messages: 140 Registered: August 2020 Location: USA
|
Senior Member |
|
|
Hello,
Tables 2.18 and 2.19 are among households but we still need to select for de jure residents for this indicator. To do this you must start with the PR file the collapse to the household level. If you are interested in these indicators at the individual level instead of the household level then you do not need to perform the collapse. The Stata code below will match the tables.
Thank you.
Best,
Shireen Assaf
The DHS Program
gen wt=hv005/1000000
*create the indicator among adults selecting for de jure and the age range
gen foodadult=sh124d if hv102==1 & inrange(hv105,18,95)
*create dummy variables for each category
tab foodadult, gen(cfoodadult)
*create the indicator among children selecting for de jure and the age range
gen foodchild=sh124e if hv102==1 & inrange(hv105,0,17)
*create dummy variables for each category
tab foodchild, gen(cfoodchild)
*collapse to household level
collapse (mean) cfood* hv005 [iw=wt] , by(hv001 hv002)
gen wt=hv005/1000000
*tabulate all categories to match tables 2.18 and 2.19.
tab1 cfood* [iw=wt]
|
|
|