Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.regsubsets

Graphical table of best subsets


Description

Plots a table of models showing which variables are in each model. The models are ordered by the specified model selection statistic. This plot is particularly useful when there are more than ten or so models and the simple table produced by summary.regsubsets is too big to read.

Usage

## S3 method for class 'regsubsets'
plot(x, labels=obj$xnames, main=NULL, scale=c("bic", "Cp", "adjr2", "r2"),
col=gray(seq(0, 0.9, length = 10)),...)

Arguments

x

regsubsets object

labels

variable names

main

title for plot

scale

which summary statistic to use for ordering plots

col

Colors: the last color should be close to but distinct from white

...

other arguments

Value

None

Author(s)

Thomas Lumley, based on a concept by Merlise Clyde

See Also

Examples

data(swiss)
a<-regsubsets(Fertility~.,nbest=3,data=swiss)
par(mfrow=c(1,2))
plot(a)
plot(a,scale="r2")

leaps

Regression Subset Selection

v3.1
GPL (>= 2)
Authors
Thomas Lumley based on Fortran code by Alan Miller
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.