[R-sig-ME] Bootstrapping an lmer model

Christoph Scherber Christoph.Scherber at agr.uni-goettingen.de
Thu Nov 3 14:55:39 CET 2011


Dear all,

Has anyone written some code to get predicted values from an lmer model using bootstrapping?

The only available method seems to be the sim() function in package "Zelig". This works well if you don´t do bootstrapping. However, it doesn´t seem
to work for bootstrap=TRUE:

##
require(Zelig)
data(voteincome)

z.out1 <- zelig(vote ~ education + age + female + tag(1 | state),
data = voteincome, model = "logit.mixed")

x <- setx(z.out1, education = 4)
s.out1 <- sim(z.out1, x = x, bootstrap=TRUE)

#Error in `*tmp*`$call : $ operator not defined for this S4 class

##

I´ve tried to modify some of the internal code from the sim() function, but couldn´t get it to work until now.

I would greatly appreciate any help, ideas or suggestions.

Best wishes,
Christoph

(using R 2.13.2 on Windows 7 64-Bit)




-- 
Dr. Christoph Scherber
Georg-August-University Goettingen
Department of Crop Science
Agroecology
Grisebachstrasse 6
37077 Goettingen
tel +49 (0)551 39 8807
fax +49 (0)551 39 8806
www.gwdg.de/~cscherb1


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