[R-sig-ME] Predict method for lmer

Ben Bolker bbolker at gmail.com
Wed Nov 27 22:59:30 CET 2013


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



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