Skip to content
Prev 13455 / 20628 Next

mixed effect modeling with imputed data set

Use one of the apply functions to iterate over your imputed datasets.

If your imputed datasets are in columns 5 through n+4 of "mydata" (i.e. 
assuming that x1, x2, x3, and regioid are in columns 1:4), the you could 
do something like:

model.list <- lapply(1:n, function(i)

glmer(mydata[,i+4] ~ x1+x2 +x3+(1|regiogid),family= binomial("logit"), data=mydata) )

The output will then be a list of model objects (i.e. model fits).  You 
can then iterated through this results list in order to calculate mean 
parameter values from all your imputed data fits.

Or, likewise:

model.list <- lapply(5:ncol(mydata), function(i) ...

Hope this helps,
Dan.
ali via R-sig-mixed-models wrote: