The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » Food security- South Africa DHS 2016 (Number of households)
Food security- South Africa DHS 2016 [message #21901] Thu, 07 January 2021 00:05 Go to next message
Shek is currently offline  Shek
Messages: 19
Registered: November 2014
Member
I am having problem replicating the number of households reported in table 2.18 (Food security adults, number of household=11,016) and table 2.19 (Food security children, number of hoousehold=5923) in the 2016 South Africa Demographic Health Survey report.

The number of households i got those not tally with the table.

I would be glad if someone could assist me with the codes.

Thank you very much.

[Updated on: Thu, 07 January 2021 00:05]

Report message to a moderator

Re: Food security- South Africa DHS 2016 [message #21975 is a reply to message #21901] Tue, 12 January 2021 12:27 Go to previous messageGo to next message
Shireen-DHS is currently offline  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]


Re: Food security- South Africa DHS 2016 [message #21987 is a reply to message #21975] Wed, 13 January 2021 12:04 Go to previous message
Shek is currently offline  Shek
Messages: 19
Registered: November 2014
Member
Dear Shireen,

Thank you very much for your assistance

Kind regards
Previous Topic: Trend analysis for Nutritional status of children
Next Topic: Discrepancy with estimates from Tables 11.1 and 11.2 in Niger 2012 DHS
Goto Forum:
  


Current Time: Sat Dec 28 04:54:28 Coordinated Universal Time 2024