It worked for me. I think the main thing is not to blindly include all the parameters in the model call. Most of them have default values, so (if the package writer has done his job) you should leave them as they are and not worry too much (although, of course, you should RTFM and (try) to understand what they mean .. .)
dat <- read.csv("GPPdriversRhineland.csv") library(glmulti)
I decided to rename the predictor with shorter tags:
prednames <- c("NDVI","solar.rad","avg.temp","precip", "nutr.avail","water.cap") names(dat)[1:6] <- prednames
This is all you need to match all the combinations of the main effects: since you have six predictors, there are 64 level 1 models (including the null model).
g1 <- glmulti("GPP",xr=prednames,data=dat,level=1)
For a larger computational task:
g2 <- glmulti("GPP",xr=prednames,data=dat,level=2)
I believe that there is 2^(choose(6,2)+6)
= 2.1 million possible models. I did not look at ?glmulti
close enough to say how to stop the installation of models. I just started (so far he has evaluated 66,000 models), but he found a two-level model with an AIC of about 500.5, which is much better than min-AIC 518 in a set of 1-level models ..
PS I played with the settings a little more, trying to use a genetic algorithm, rather than an exhaustive approach (I see no obvious way to tell glmulti
"use an exhaustive approach, but stop after N attempts"). Even with slightly more permissive than the default settings for the genetic algorithm, it seems to be stuck on the AIC by about 504, higher than the value found in the (partial) comprehensive screening I tried first.
eg:.
g2 <- glmulti("GPP",xr=prednames,data=dat,level=2,marginality=TRUE, method="g",conseq=25,popsize=500,mutrate=1e-2)
PPS : the reason I got the best results in the exhaustive case was because I had marginality=FALSE
, i.e. the model was allowed to leave the main effect parameters that were involved in the interactions included in the model. This is not necessarily reasonable. If I turn off the marginality restriction, then the genetic algorithm can go down to AIC = 499 without any problems ...
glmulti("GPP",xr=prednames,data=dat,level=2,marginality=TRUE, method="d")
also useful: it prints the number of candidate models defined for this specification.