glmulti and liner mixed models

前端 未结 2 1787
甜味超标
甜味超标 2020-12-10 10:07

I have a problem with the glmulti package and linear mixed models. When I try to estimate the model-averaged coefficients with the coff.glmulti function I get this error:

2条回答
  •  北海茫月
    2020-12-10 10:37

    If you are using one of the latest versions of lme4, the getfit() function I recommended is no longer adapted. Indeed, the lme4 package maintainers have made quite a lot of changes in their package: the class of objects is now "merMod", where it was "mer", and a few other things.

    Then the getfit function must be slightly adjusted in order to interface glmulti with the new lme4 structure. Here a a getfit definition that works with the latest builds of lme4 for Ubuntu 12.04, as of yesterday:

    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))))
    })
    

    This should fix the issue. [see also my website http://vcalcagnoresearch.wordpress.com/package-glmulti/] Regards

提交回复
热议问题