see_models {regclass} | R Documentation |
Examining model AICs from the "all possible" regressions procedure using regsubsets
Description
This function takes the output of regsubsets
and prints out a table of the top performing models based on AIC criteria.
Usage
see_models(ALLMODELS,report=0,aicc=FALSE,reltomin=FALSE)
Arguments
ALLMODELS |
An object of class regsubsets created from |
report |
An optional argument specifying the number of top models to print out. If left at a default of 0, the function reports all models whose AICs are within 4 of the lowest overall AIC. |
aicc |
Either |
reltomin |
Either |
Details
This function uses the summary
function applied to the output of regsubsets
. The AIC is calculated to be the one obtained via extractAIC
to allow for easy comparison with build.model
and step
.
Although the model with the lowest AIC is typically chosen when making a descriptive model, models with AICs within 2 are essentially functionally equivalent. Any model with an AIC within 2 of the smallest is a reasonable choice since there is no statistical reason to prefer one over the other. The function returns a data frame of the AIC (or AICc), the number of variables, and the predictors in the "best" models.
Recall that the function regsubsets
by default considers up to 8 predictors and does not preserve model hierarchy. Interactions may appear without both component terms. Further, only a subset of the indicator variables used to represent a categorical variable may appear.
Author(s)
Adam Petrie
References
Introduction to Regression and Modeling
See Also
Examples
data(SALARY)
ALL <- regsubsets(Salary~.^2,data=SALARY,method="exhaustive",nbest=4)
see_models(ALL)
#By default, regsubsets considers up to 8 predictors, here it looks at up to 15
data(ATTRACTF)
ALL <- regsubsets(Score~.,data=ATTRACTF,nvmax=15,nbest=1)
see_models(ALL,aicc=TRUE,report=5)