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

 Sampling Weigths for children under 5 By: rafaaqp1990 on Fri, 29 May 2020 11:16 Re: Sampling Weigths for children under 5 By: Liz-DHS on Mon, 01 June 2020 10:43 Re: Sampling Weigths for children under 5 By: rafaaqp1990 on Tue, 09 June 2020 04:57
 Previous Topic: Issues with the variable ml1 (fansidar) Next Topic: About the Data extraction
Goto Forum:

Current Time: Mon Dec 11 14:41:19 Coordinated Universal Time 2023