The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » Sampling Weigths for children under 5 (Using R)
Sampling Weigths for children under 5 Fri, 29 May 2020 11:16
 rafaaqp1990 Messages: 2Registered: May 2020 Member
Dear all,
I am new to survey data and I am having trouble trying to find my error in my R-Code. I chose Philippines 2017 and I am trying to calculate the percentage of vitamin A supplementation for this country for children under 5.

This is my R-Code

# Using labels as column names
var.labels <- attr(phi17, "var.labels")
names(phi17) <- var.labels

For speficying the model I use the following code:

# Simplifying column names
phi17\$weight <- as.numeric(phi17\$`women's individual sample weight (6 decimals)`/1000000)
phi17\$psu <- phi17\$`primary sampling unit`
phi17\$strata <- phi17\$`stratification used in sample design`
phi17\$vi_a = phi17\$`vitamin a in last 6 months`

phi_17_design <- svydesign(~ psu,
strata = ~strata,
weights = ~ weight,
data = phi_17)

So, I used the weights for the women but when I calculate the percentage of children who received a vitamin A supplement in the last 6 months in Philippines 2017, i get the following results:
svymean(~ vi_a, phi_17_design, na.rm = TRUE) --> yes: 69.47%

HOWEVER, when I read the final report, the result should actually be 76%.

Does anyone recognize the mistake? Did I specified the weigths correctly??

Best regards

rafaaqp1990

Re: Sampling Weigths for children under 5 [message #19333 is a reply to message #19318] Mon, 01 June 2020 10:43
 Liz-DHS Messages: 1516Registered: February 2013 Senior Member
A response from Senior Manager, Analysis and Research, Shireen Assaf:
Quote:

Hello,

I could not see how you coded the variable or what variables you used for the weight, strata, or PSU.
For this survey the strata variable is v023. The weight for KR files is v005 and the psu is v021.

To code the indicator, please translate the Stata code available on GitHub in the NT_CH_MICRO.do file: https://github.com/DHSProgram/DHS-Indicators-Stata/tree/mast er/Chap11_NT
You will also need to check the master file (!NTmaster.do) for this chapter to see how the age variable was coded (age is b19 for recent DHS surveys). If you do not have Stata, you can open these do files using notepad.

A description of how this variable is coded can be found in the Guide to DHS Statistics: https://www.dhsprogram.com/Data/Guide-to-DHS-Statistics/inde x.htm#t=Micronutrient_Intake_among_Children.htm . See indicator #5 and how the numerator and denominator are defined.

Thank you.
Best,
Shireen Assaf

Re: Sampling Weigths for children under 5 [message #19383 is a reply to message #19333] Tue, 09 June 2020 04:57
 rafaaqp1990 Messages: 2Registered: May 2020 Member
Thank you so much!
I will try this.
 Previous Topic: Issues with the variable ml1 (fansidar) Next Topic: About the Data extraction
Goto Forum:

Current Time: Wed Jul 24 17:36:58 Coordinated Universal Time 2024