The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Bangladesh » Number of respondents mismatch in dataset and published report
Re: Number of respondents mismatch in dataset and published report [message #12425 is a reply to message #12423] Mon, 15 May 2017 11:22 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3035
Registered: February 2013
Senior Member

Following is a response from Senior DHS Stata Specialist, Tom Pullum and DHS Senior Research Associate, Shireen Assaf:

The difference between the 6167 and the 5047 is completely due to the use of weights. Below I will paste the results in Stata, first without weights and second with weights, using BDIR70FL.dta. I do this with iweight but you can also do it with pweight, svyset, and svy.

index.php?t=getfile&id=722&private=0

To produce the weighted table in R, you would need to use the survey package. The following lines should help you get started.

library(survey)
# install and load the survey package
options(survey.lonely.psu="adjust") 
# to fix the issue with strata with single PSU
# adjust will center the stratum at the population mean

data$wt = data$v005/1000000
# create the weight variable

mydesign<-svydesign(id=data$v021, data=data, strata=data$v023,  weight=data$wt, nest=T)
# set the survey design using the uploaded data (named data), the cluster (v021), the strata (v023) , and the weight (wt).
# then use svymean or svytable to get the weighted proportions and frequencies of your variables.  See the survey package documentation for further details. 



  • Attachment: tab-v025.jpg
    (Size: 28.26KB, Downloaded 660 times)

[Updated on: Mon, 15 May 2017 11:23]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Height and Weight
Next Topic: Mother's education
Goto Forum:
  


Current Time: Sat Apr 20 09:03:34 Coordinated Universal Time 2024