An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20131125/6542a51c/attachment.pl>
Predict method for lmer
2 messages · Nathan E. Rutenbeck, Ben Bolker
1 day later
Nathan E. Rutenbeck <nerutenbeck at ...> writes:
Hi all, I am struggling to use predict.merMod to generate predictions from a relatively simple mixed model.
[snip snip snip]
Example code follows: mer0 <- lmer ( top ~ 1 + (1|stand), data=data) mer0.1 <- update( mer0, .~. + (1|species))
[more snippage]
mer2 <- update(mer1, .~. + (DBH|Species) predict(mer2, newdata=data, allow.new.levels=T) # This fails with the following error: Error in t(.Call(Csparse_dense_crossprod, y, t(x))) : error in evaluating the argument 'x' in selecting a method for function 't': Error: Cholmod error 'X and/or Y have wrong dimensions' at file ../MatrixOps/cholmod_sdmult.c, line 90 It seems that I am failing to provide the proper matrix format for the newdata argument, but I don't necessarily see how to fix it. Thanks in advance, -Nathan Rutenbeck
This is probably a bug (i.e. not your fault), but possibly one that has
been fixed more recently. Can you please:
* try installing the development version, either from Github or via
install.packages("lme4",repos="http://lme4.r-forge.r-project.org/repos")
and see if that helps?
* send me a _small_ reproducible example?
Ben Bolker