Skip to content
Prev 6920 / 20628 Next

Bootstrapping an lmer model

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)