mixed effect modeling with imputed data set
mice is very easy to use and customise, I haven't used Stata's routines but they seem a bit more complex to use but maybe less powerful. The advantage with using mice is it is just a few statements to set up the analysis. The author of mice has a book describing the capabilities and methods.
On 17 June 2015 at 11:21, Ben Bolker <bbolker at gmail.com> wrote:
For convenience, you might want to consider using imputation with the 'mice' package in order to stay within R for your analysis (I don't know Stata's capabilities in this area; I'd expect them to be pretty good, but it is my impression that 'mice' is also quite well-written/full-featured) On Tue, Jun 16, 2015 at 12:26 PM, Daniel Fulop <dfulop.ucd at gmail.com> wrote:
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
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
*Ken Beath* Lecturer Statistics Department MACQUARIE UNIVERSITY NSW 2109, Australia Phone: +61 (0)2 9850 8516 Level 2, AHH http://stat.mq.edu.au/our_staff/staff_-_alphabetical/staff/beath,_ken/ CRICOS Provider No 00002J This message is intended for the addressee named and may...{{dropped:9}}