I would like to set up the survey design for Cote d'Ivoire DHS using R (2011-2012). I am focused on domestic violence.
I used this code:
wt <- ipv_studyf$d005/1000000 # creating the variable weight
ipvdesign <- svydesign(ids = ipv_studyf$v021, # clustering- psu
strata = ipv_studyf$v023, # strata variable
weights = wt, # the weighting variable
data = ipv_studyf, # the dataset
variance="HT" ) # Horvitz-Thompson estimator
However, I keep getting this error message:
**Error in na.weight(data.frame(weights)) : missing values in `weights'**
If anyone has any insights on how to set up the dataset in R and help me fix this error message, I would appreciate the help!