[R-sig-ME] Predict method for lmer
Nathan E. Rutenbeck
nerutenbeck at gmail.com
Fri Nov 29 18:07:20 CET 2013
>> 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
Hi Ben,
Thanks for the tip. I can report back that the development version of
lme4 solved all my woes.
-Nathan
More information about the R-sig-mixed-models
mailing list