1
$\begingroup$

I have been using the glmulti package in R to perform variable selection on a data set using the genetic algorithm, with AICc as the information criterion to be minimized. The issue I'm running into is that glmulti has been returning a list of several optimal models (with similar selected covariates) which it claims have the exact same AICc value.

I've checked these models manually myself and they do not have the same AICc. So it seems like glmulti is reporting the wrong AICc values in this example. Below is the IC curve glmulti generated.

The model I'm trying to fit is a LMM with a random effect for the year an observation was sampled (YearF).

enter image description here

Here's the code I'm using to call glmulti:

lmer.glmulti <- function(formula, data, always="+(1|YearF)",...) {
lmer(as.formula(paste(deparse(formula),always)), data=data, REML=FALSE, ...)


fit.all <- glmulti(y="logCount", xr=LME_var, data=x, level=1, 
               fitfunction=lmer.glmulti, crit='aicc', 
               maxK=10, method='g', plotty = FALSE)

Has anyone else run into this issue?

$\endgroup$
1
  • $\begingroup$ I have the same issue when I have random parameters in a Poisson model. Did you figure out the issue by any chance? $\endgroup$
    – Fred
    Commented Apr 2, 2019 at 16:23

1 Answer 1

1
$\begingroup$

The problem comes from the combination of paste and deparse. If you are still wondering, look at this:

https://stackoverflow.com/questions/25959306/glmulti-lmer-fit-linear-mixed-models-and-gls-fit-modelslme-package

If you define the lmer.glmulti function the way it is defined in the first answer of the above link (fifth grey box from the top), the issue will be fixed.

lmer.glmulti<-function(formula,data,random="",...) {
    newf <- formula
    newf[[3]] <- substitute(f+r,
                            list(f=newf[[3]],
                                 r=reformulate(random)[[2]]))
    lmer(newf,data=data,
         REML=FALSE,...)
}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.