0

I'm using the glmulti package to do variable selection on the fixed effects of a mixed model in lme4. I had the same problem retrieving coefficients and confidence intervals that was solved by the author of the package in this thread. Namely using the coef or coef.multi gives an check.names error and the coefficients are listed as NULL when calling the predict method. So I tried the solution listed on the thread linked above, using:

setMethod('getfit', 'merMod', function(object, ...) {
summ=summary(object)$coef
summ1=summ[,1:2]
if (length(dimnames(summ)[[1]])==1) {
    summ1=matrix(summ1, nr=1, dimnames=list(c("(Intercept)"),c("Estimate","Std.    Error")))
}
cbind(summ1, df=rep(10000,length(fixef(object))))
})

I fixed the missed " in the original post and the code ran. But, now instead of getting

Error in data.frame(..., check.names = FALSE) :arguments imply differing number of rows: 1, 0

I get this error for every single model...

Error in calculation of the Satterthwaite's approximation. The output of lme4 package is returned summary from lme4 is returned some computational error has occurred in lmerTest

I'm using lmerTest and it doesn't surprise me that it would fail if glmulti can't pull the correct info from the model. So really it's the first two lines of the error that are probably what should be focussed on.

A description of the original fix is on the developers website here. Clearly the package hasn't been updated in awhile, and yes I should probably learn a new package...but until then I'm hoping for a fix. I'll contact the developer directly through his website. But, in the mean time, has anyone tried this and found a fix?

lme4 glmulti rJava and other related packages have all been updated to the latest version.

JHegg
  • 61
  • 1
  • 10
  • I don't see any glmulti functions in your code. – IRTFM Oct 26 '17 at 15:45
  • Please see the thread I linked to in the first paragraph. Calling the `coef(object, ...)` function, the `coef.glmulti(object, ...)` or the predict(object, ...)` methods all result in errors as described regardless of the `glmulti` object used. There is a reproducible example in that thread which results in the same errors. – JHegg Oct 26 '17 at 18:53
  • the `setMethod` code changes the way the `getfit` function pulls out the relevant pieces of the model objects from within the `glmulti` object. This functionality is described in the `glmulti` manual [here](https://cran.r-project.org/web/packages/glmulti/glmulti.pdf), starting on page 7, page 4 for the `coef.glmulti()` function that includes the `coef` and `predict` calls and how they should work. – JHegg Oct 26 '17 at 19:00

0 Answers0