The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » How to Weight Data in R
How to Weight Data in R [message #179] Thu, 21 March 2013 16:17 Go to previous message
Jewel is currently offline  Jewel
Messages: 1
Registered: March 2013
Location: United States
Member
I am trying to use the package "Survey" in R to do a DHS analysis, but I want to be sure that I am setting up the weights properly.
My general code is as follows:

weight<-mydhsdata$v005/1000000
> data <- svydesign(id = mydhsdata$caseid, strata=mydhsdata$v021,
+ weights = weight,
+ data=mydhsdata)


If anyone has any insights on how to set up the dataset in R, I would appreciate the help!
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Pooling 3 rounds of DHS Nepal -- weights?
Next Topic: Applying weights for HIV Prevalence
Goto Forum:
  


Current Time: Fri Mar 29 08:09:42 Coordinated Universal Time 2024