The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » Problems with of Malawi 2010 DHS in survey package (R)
Problems with of Malawi 2010 DHS in survey package (R) [message #15363] Thu, 05 July 2018 15:49 Go to previous message
JulianneMeisner is currently offline  JulianneMeisner
Messages: 1
Registered: July 2018
Location: Seattle
Member
Hi everyone,

I'm trying to perform small area estimation on household cattle ownership for the 2010 Malawi DHS, using the survey package in R.

I have created the dataset "data" by merging MWHR61FL.DTA and MWIR61FL.DTA on household ID, which I generated from "v001" and "v002" in the individual (MWIR61FL.DTA) dataset, and from "hv001" and "hv002" in the household (MWHR61FL.DTA) dataset.

My code is as follows:
dhs.des<-svydesign(id=data$v021, weights=data$v005/1000000, strata=data$v022, data=data)
cattle<-svyby(~hv246a, ~v001, dhs.des2, svymean)

This gives nonsensical standard errors (mean 4.3e-17), as does svytotal.

Before chasing down a problem with the survey package or my implementation of it, I wanted to make sure that I'm setting up the design correctly in the svydesign command.

Many thanks,
Julianne
 
Read Message
Read Message
Previous Topic: Country-level weights for MLM
Next Topic: weighting and creating SVY command for multilevel analysis of two level of data SPA -NEPAL
Goto Forum:
  


Current Time: Wed Apr 24 11:11:11 Coordinated Universal Time 2024