0

I'm using a leave-one-out method to evaluate how well a model with one datapoint excluded predicts that datapoint (rotating through all datapoints). The code below has successfully run on essentially the same data with a slightly different DV, so I'm stumped as to why I'm getting the error that I'm getting. Here's the relevant chunk of code:

dataPennTrim.lmer <- lmer(logDur.PENN~cNewNounDen*ContextCode+
     Vowel.Contrasts+BlockCode+
     (1|subject)+(0+ cNewNounDen +ContextCode|subject)+
     (1|word)+(0+ContextCode|word),
data=pennTrim,
control = lmerControl(optimizer = "bobyqa"),REML=FALSE)
pennPred <- predict(dataPennTrim.lmer, newdata = dataFull2)

dataFull2 has the same columns as pennTrim, it just has more rows. Pretty standard use of the predict() function. I get this error:

Error in t(.Call(Csparse_dense_crossprod, y, 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

Any thoughts about what might be causing this error? I can use essentially the same code with the same dataframes swapping out logDur.PENN for logDur.Manual (measurements from a different source) and the code gives no errors.

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Googling on "lme4 wrong dimensions" leads me to https://github.com/lme4/lme4/issues/257 . Can you install the development version (this fix hasn't made it to a released version yet) and see if that fixes the problem? – Ben Bolker Mar 20 '15 at 21:18
  • Hi Ben, I tried installing the development version as shown in other forum posts (install.packages("lme4",repos="http://lme4.r-forge.r-project.org/repos")) but I get a bunch of warnings. Is that install.packages command correct? – Erin Gustafson Mar 23 '15 at 16:30
  • Warning in install.packages : unable to access index for repository lme4.r-forge.r-project.org/repos/bin/macosx/mavericks/contrib/3.1 Warning in install.packages : package ‘lme4’ is not available (for R version 3.1.2) – Erin Gustafson Mar 24 '15 at 20:16
  • if you have development tools (compiler etc.) installed then adding `type="source"` should work. Otherwise I might have to build a new binary/update the repository. – Ben Bolker Mar 24 '15 at 20:43
  • No, I don't have any developer tools installed that I know of; I got the same warnings when I added type="source". I appreciate your help with this. – Erin Gustafson Mar 26 '15 at 18:22

0 Answers0