[R-sig-ME] Predict method for lmer

Ben Bolker bbolker at gmail.com
Mon Dec 2 23:40:33 CET 2013


On 13-11-29 12:07 PM, Nathan E. Rutenbeck wrote:
> 
>>> 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

  Thanks for reporting back, and thank goodness your problem is already
resolved in the development version -- we're deep in petty bugs here at
lme4 central, we don't need any more (although that shouldn't discourage
people from reporting them if they're out there!)

  Ben Bolker



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