[R-meta] Model selection: Model matrix not of full rank

Michael Dewey lists at dewey.myzen.co.uk
Mon Mar 12 14:26:31 CET 2018

Dear Cesar

Comments inline

On 12/03/2018 10:45, Cesar Terrer Moreno wrote:
> Hi, I am running a model selection analysis using metafor and glmulti in order to find the most important predictors driving an effect size:
> rma.glmulti <- function(formula, data, ...) {
>    rma(as.formula(paste(deparse(formula))), var, data=data, method="ML", knha=TRUE,  control=list(stepadj=.5),...)
> }
> res.ECM <- glmulti(es ~ CNr + ph + MAT + MAP + deltaco2 + Biome,
>                     dat=ecmdat,level=2, fitfunction=rma.glmulti, crit="aicc", confsetsize=2^6)
> I know the number of moderators is probably too high for a model with interactions (level=2), but anyway after a while running the process I got this error:

I suspect your observation is probably correct. Can you fit the model 
with rma.uni using (CNr + ph + MAT + MAP + deltaco2 + Biome)^2 as the 

> Error in rma(as.formula(paste(deparse(formula))), var, data = data, method = "ML",  :
>    Model matrix not of full rank. Cannot fit model.
> In addition: There were 50 or more warnings (use warnings() to see the first 50)

What were the warnings?

> How can I avoid this error to make the whole process run until the end? It seems like an error unrelated to metafor or glmulti, but I can’t really find a solution to this error.

I think you may have to choose a simpler model. I think your comment is 
probably correct, this is a general problem of model complexity not 
specific to the particular packages you are using.

> Thanks
> _______________________________________________
> R-sig-meta-analysis mailing list
> R-sig-meta-analysis at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis


More information about the R-sig-meta-analysis mailing list