[R-sig-ME] mixed effect modeling with imputed data set

Daniel Fulop dfulop.ucd at gmail.com
Tue Jun 16 18:26:59 CEST 2015


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:
> Hi all
> I imputed my data using multiple imputation procedure in STATA. I would like
> to conduct mixed effect modeling on the imputed data set in R. I do not know
> how to write the code over the imputed data set.
> My code is:	
> fit<- glmer(y ~ x1+x2 +x3+(1|regiogid),family= binomial("logit"), data =mydata)
>
> Best Regards
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-- 
Daniel Fulop, Ph.D.
Postdoctoral Scholar
Dept. Plant Biology, UC Davis
Maloof Lab, Rm. 2220
Life Sciences Addition, One Shields Ave.
Davis, CA 95616

510-253-7462
dfulop at ucdavis.edu



More information about the R-sig-mixed-models mailing list