leaps() performs an exhaustive search for the best subsets of the
variables in x for predicting y in linear regression, using an efficient
branch-and-bound algorithm. It is a compatibility wrapper for
regsubsets does the same thing better.
Since the algorithm returns a best model of each size, the results do
not depend on a penalty model for model size: it doesn't make any
difference whether you want to use AIC, BIC, CIC, DIC, ...
Total degrees of freedom to use instead of nrow(x) in calculating Cp and adjusted R-squared
strictly.compatible
Implement misfeatures of leaps() in S
Value
A list with components
which
logical matrix. Each row can be used to select the columns of x in the respective model
size
Number of variables, including intercept if any, in the model
cp
or adjr2 or r2 is the value of the chosen model
selection statistic for each model
label
vector of names for the columns of x
Note
With strictly.compatible=T the function will stop with an error if x is not of full rank or if it has more than 31 columns. It will ignore the column names of x even if names==NULL and will replace them with "0" to "9", "A" to "Z".
References
Alan Miller "Subset Selection in Regression" Chapman & Hall