The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » India » survey weights in R (stuck up in integrating survey weights in analyzing the DHS7 India data)
survey weights in R [message #25942] Thu, 12 January 2023 21:44 Go to previous message
dhivvyajp@am.amrita.edu is currently offline  dhivvyajp@am.amrita.edu
Messages: 4
Registered: January 2023
Member
I am currently working on this dataset IAMR7DFL.DTA
I am looking forward to use survey weights for the chi-square test and logistic regression. After searching in the internet, I came across this piece of code.

my_design <-svydesign(id=~Mendata$psu, weights=~Mendata$wt, strata=Mendata$strata, data=Mendata, survey.lonely.psu = "adjust")

It worked and my_design shows this

> my_design
Stratified 1 - level Cluster Sampling design (with replacement)
With (9102) clusters.
svydesign(id = ~Mendata$psu, weights = ~Mendata$wt, strata = Mendata$strata,
data = Mendata, survey.lonely.psu = "adjust")

After that when I am doing the chi-square test like this,
I am getting the following error.

> svychisq(~InternetUsage+RuralOrUrban, my_design, statistic="adjWald")
Error in onestrat(x[index, , drop = FALSE], clusters[index], nPSU[index][1], :
Stratum (51) has only one PSU at stage 1

Kindly help me to resolve this issue and also please specify the analysis of chi-square test and logistic regression with and without survey weights.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Missing Region for 2015 SPSS India dataset
Next Topic: Inconsistencies in heights between NFHS-3 NFHS-4
Goto Forum:
  


Current Time: Sat Nov 30 16:25:17 Coordinated Universal Time 2024