Description Usage Arguments Details Author(s) References See Also Examples
This function takes the output of regsubsets
and prints out a table of the top performing models based on AIC criteria.
1 | see_models(ALLMODELS,report=0,aicc=FALSE,reltomin=FALSE)
|
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 |
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.
Adam Petrie
Introduction to Regression and Modeling
1 2 3 4 5 6 7 8 9 10 |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.