Solved – Survey Weighted Random Effects Logit Model in R

logisticmixed modelrsurveysurvey-weights

I am trying to predict a binary outcome with a model that includes a random effect using survey data. I've included a description of the sampling design below, so feel free to comment on my survey weighting approach. My primary question is how to include a random effect in the survey weighted model. Here is the code up to this point:

# Libraries
library(survey)
# Make dataframe object where d is the working dataframe
dfobj <- svydesign((id = ~cluster+household, 
   strata = ~interaction(region, urban),  
   weights = ~chweight, strata = ~strata, data = d)

# Run a logit model
formula1 <- stunting ~ modern_toilet + diarrhoea + fever 
   + insurance + sex + age + region_code
model1 <- svyglm(formula=formula1,design=dfobj,family = quasibinomial)

I would like the random effect to be on the region. Thanks,

Sampling Description:

The MICS 2006 used a two-stage stratified sample design. At the first stage of sampling, 300
census enumeration areas (124 urban and 176 rural EAs) were selected. These are a subsample
of the 660 EAs (281 urban and 379 rural) selected for the GLSS 5. The clusters in each
region were selected using systematic sampling with probability proportional to their size.

Best Answer

I have been unable to have R perform mixed effect logistic regression with appropriate weights to my liking. By appropriate, I mean with weights scaling as discussed by Pfeffermann et. al. (1998). There's just too much going on for lme4 to bother with the sampling weights.

I know that this sounds like the end of the world to R users (can you believe that something is not implemented in R???), but as of mid 2016, the solutions seem to be gllamm in Stata (written, for goodness sake, back in 2001) -- see http://gllamm.org -- where you can specify anything, at the cost of convoluted data reshaping and management -- and SAS PROC GLIMMIX.

Related Question