Hi,
I have been using the *sim *function in the arm package to simulate glm
models in R and then extract random effects.
mymodel =lmer(y~x1+x2+x3+(1|ID),data=mydataset)
mysim=sim(mymodel,n.sims=1000)
simulated_raneffs=as.data.frame(mysim at ranef)
However, it seems that the *sim *function doesn?t work with additive
(gam/bam) models. Is there any alternative for simulating gam/bam models to
later extract random effects?
Thanks,
David