1

Is there a way to retain the best models, for example, within two Alkaike Information Criterion (AIC) units of the best fitting model, during a model dredging approach in R? I am using the glmulti package, which returns the AIC of the best models, but does not allow visualizing the models associated with those values.

Thanks in advance.

Here is my example (data here):

results <- read.csv("gameresults.csv") require(glmulti) M <- glmulti(result~speed*svl*tailsize*strategy, data=results, name = "glmulti.analysis", intercept = TRUE, marginality = FALSE, level = 2, minsize = 0, maxsize = -1, minK = 0, maxK = -1, fitfunction = Multinom, method = "h", crit = "aic", confsetsize = 100,includeobjects=TRUE) summary(M) 
2
  • Do you have an example that you have tried? Commented Feb 15, 2017 at 13:57
  • Sure, there it is. Commented Feb 15, 2017 at 17:34

1 Answer 1

0

The function glmulti::glmulti returns a S4 class object that can be accessed like a list. All of your models, not just the best, could be accessed. Since I don't have your functions and some other optional inputs, I performed a simplified version of your model just as a demonstration:

results <- read.csv("gameresults.csv") library(glmulti) M <- glmulti(result~speed*svl*strategy, data=results, crit = "aic", plotty = TRUE) 

enter image description here Here are a list of all models, accessed by the @ operator:

M@formulas # [[1]] # result ~ 1 + speed + svl:speed + strategy:speed # <environment: 0x11a616750> # # [[2]] # result ~ 1 + speed + svl + svl:speed + strategy:speed # <environment: 0x11a616750> # # [[3]] # result ~ 1 + strategy + speed + svl:speed + strategy:speed # <environment: 0x11a616750> # ## **I omitted the remaining 36-3=33 models** 

You can plot them individually based on the formula, using the base graphic or any packages that support use of model formulas. For example, I randomly selected one from the list:

plot(result ~ 1 + speed + svl, data=results) ## Hit <Return> to see next plot: ## Hit <Return> to see next plot: 

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Many thanks,however the question remains, it is not close to clear for me to filter the models with lowest AIC. There are many "AIC" slots in that huge S4 object and i even if i knew the path to the rigth one, i dont even have a clue on how to use those AIC values to solve my original question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.