0
votes

I have run lmerTest and lmer in R in the version 2013:

> library(lmerTest)
> data1.frame <- read.delim("colorness.txt", fileEncoding="UTF-16")
> str(data1.frame)
> lmer3 <- lmerTest::lmer(duration ~ (1|item) + (1+color|speaker) + group*color*sex, data=data1.frame, REML=FALSE, na.action=na.omit)

The lmer3 works fine for me. And when I checked the data in str(data1.frame), there is nothing wrong.

But when I put this command

> summary(lmer3)

It gives me this message:

Error in `colnames<-`(`*tmp*`, value = c("Estimate", "Std. Error", "df",  : 
  length of 'dimnames' [2] not equal to array extent

However, I am quite sure there is nothing wrong in my data as I can run lmer in R version 2009. Do you have any idea how to solve this issue? The thing is that if I stick with R version 2009, then I cannot get p-values from lmerTest, and I don't know how to get it from likelihood ratio test. Do you have any idea about this?

1
You should provide some representative data and your code. This is too vague for anyone to hazard a guess.asb
OK, I'll do in a minute. I just have uninstalled R a moment ago, and waiting for school technician to reinstall it for me. Thanks for suggestion, asb.user3288202
Hi asb, I have added more information for you so that you might be able to point out problem. Your suggestions will be useful for my work.user3288202
Look at the "Depends" field on the CRAN page. If your setup doesn't fulfill the listed requirements you should not be suprised by problems.Roland
Hi Roland, but the formula works fine when I run it with the other measurement. That is why I am surprised what is wrong.user3288202

1 Answers

2
votes

sorry to post this as an answer, but I still do not have enough "reputation" to comment. I think it is a bug and/or depends on the data, because I have the same problem. I have a large dataset, and the model runs row-wise through it using a loop. Everything works perfectly for the first 26,478 tests (out of 34,713) but stops in the next cycle, with the same error. So:

1) it is not the version of the package, since it works perfectly for 3/4's of my dataset 2) it is not the sintax, since everything works fine in the first tens of thousands of models and an ANOVA I run previously against a null model.

My code is roughly:

for (i in 1:nrow(dataset)){
    dataframe<-as.data.frame(dataset[i,]);
    lm.R<-lmer(response ~ treatment + (1|ran)+(1|rep), dataframe, REML= FALSE);
    x<-summary(lm.R);
    p.val[i,]<-x$coefficients[,"Pr(>|t|)"];
}

and I get the same error when i = 26479

Model is not identifiable...
Error in `colnames<-`(`*tmp*`, value = c("Estimate", "Std. Error", "df",  : 
  length of 'dimnames' [2] not equal to array extent

My data is fine in that row (I doublechecked) and I cannot see any irregularity. Even the ANOVA against the null model (which I highly recommend you to do, since it gives you the p-value, loglike, AIB, etc. of your model) works perfectly.

lm.null<-lmer(response ~ 1 + (1|ran)+(1|rep), dataframe, REML= FALSE);
lm.R<-lmer(response ~ treatment + (1|ran)+(1|rep), dataframe, REML= FALSE);
anova(lm.null,lm.R);