see.models: Examining model AICs from the "all possible" regressions...

Description Usage Arguments Details Author(s) References See Also Examples

Description

This function takes the output of regsubsets and prints out a table of the top performing models based on AIC criteria.

Usage

1
see.models(ALLMODELS,report=0,aicc=FALSE,reltomin=FALSE) 

Arguments

ALLMODELS

An object of class regsubsets created from regsubsets in package leaps.

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 TRUE or FALSE. If TRUE, the AICc of a model is reported instead of the AIC.

reltomin

Either TRUE or FALSE, specifying whether the actual value of the AIC is reported (FALSE) or if AICs should be reported relative to the smallest overall AIC (TRUE)

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

regsubsets, extractAIC

Examples

 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)
	 

profpetrie/regclass documentation built on May 26, 2019, 8:33 a.m.