Print Summary for Subset Selection (regsubsets
) Objects
Source: R/print.summary.regsubsets.R
print.summary.regsubsets.Rd
Prints a summary for objects of class summary.regsubsets
or regsubsets
(from the leaps
package), showing model selection statistics for best subsets, including R-squared, adjusted R-squared, standard error of estimate, Mallows' Cp, and AIC.
Usage
# S3 method for class 'summary.regsubsets'
print(x, ...)
Details
The function prints the model call and a table summarizing the best models selected, including the number of predictors, R-squared, adjusted R-squared, standard error of estimate (SEE), Mallows' Cp, and included variables.
If the input is a regsubsets
object, it is converted to a summary with summary()
. If not, the object is returned unmodified.
Examples
if (FALSE) { # \dontrun{
library(leaps)
fit <- leaps::regsubsets(Fertility ~ ., data = swiss, nbest = 3)
print.summary.regsubsets(fit)
} # }