plot.subsets

0th

Percentile

Plot Output from regsubsets Function in leaps package

The regsubsets function in the leaps package finds optimal subsets of predictors. This function plots a measure of fit (see the statistic argument below) against subset size).

Keywords
hplot, regression
Usage
plot.subsets(object, ...)

plot.subsets.regsubsets(object, 
    names=abbreviate(object$xnames, minlength = abbrev), 
    abbrev=1, min.size=1, max.size=length(names), legend, 
    statistic=c("bic", "cp", "adjr2", "rsq", "rss"), 
    las=1, cex.subsets=1)
Arguments
object
a regsubsets object produced by the regsubsets function in the leaps package.
names
a vector of (short) names for the predictors, excluding the regression intercept, if one is present; if missing, these are derived from the predictor names in object.
abbrev
minimum number of characters to use in abbreviating predictor names.
min.size
minimum size subset to plot; default is 1.
max.size
maximum size subset to plot; default is number of predictors.
legend
TRUE to plot a legend of predictor names; defaults to TRUE if abbreviations are computed for predictor names. The legend is placed on the plot interactively with the mouse.
statistic
statistic to plot for each predictor subset; one of: "bic", Bayes Information Criterion; "cp", Mallows's $C_{p}$; "adjr2", $R^{2}$ adjusted for degrees of freedom; "rsq", unadjusted
las
if 0, ticks labels are drawn parallel to the axis; set to 1 (the default) for horizontal labels (see par).
cex.subsets
can be used to change the relative size of the characters used to plot the regression subsets; default is 1.
...
arguments to be passed down to plot.subsets.regsubsets.
Value

  • NULL. This function is used for its side effect -- to create a plot.

See Also

regsubsets

Aliases
  • plot.subsets
  • plot.subsets.regsubsets
Examples
library(leaps)
data(Ericksen)
<testonly>plot.subsets(regsubsets(undercount ~ ., data=Ericksen), legend=F)</testonly>
plot.subsets(regsubsets(undercount ~ ., data=Ericksen))
Documentation reproduced from package car, version 0.8-3, License: GPL version 2 or newer

Community examples

Looks like there are no examples yet.