plot.lmSubsets: Plot a subset regression

Description Usage Arguments Value See Also Examples

Description

Plot the deviance of the selected submodels, as well as a specified information criterion.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S3 method for class 'lmSubsets'
plot(x, penalty = "BIC", xlim, ylim_rss, ylim_ic, type_rss = "o",
     type_ic = "o", main, sub, xlab, ylab_rss, ylab_ic, legend_rss,
     legend_ic, ann = par("ann"), axes = TRUE, lty_rss = c(1, 3),
     pch_rss = c(16, 21), col_rss = "black", bg_rss = "white",
     lty_ic = c(1, 3), pch_ic = c(16, 21), col_ic = "red",
     bg_ic = "white", ...)

## S3 method for class 'lmSelect'
plot(x, xlim, ylim, type = "o", main, sub, xlab, ylab, legend,
     ann = par("ann"), axes = TRUE, lty = 1, pch = 16, col = "red",
     bg = "white", ...)

Arguments

x

"lmSubsets", "lmSelect"—a subset regression

penalty

the information criterion

xlim, ylim, ylim_rss, ylim_ic

x and y limits

type, type_rss, type_ic

type of plot

main, sub

main and sub-title

xlab, ylab, ylab_rss, ylab_ic

axis titles

legend, legend_rss, legend_ic

plot legend

ann

annotate plot

axes

plot axes

lty, lty_rss, lty_ic

line type

pch, pch_rss, pch_ic

plotting character

col, col_rss, col_ic

color

bg, bg_rss, bg_ic

background color

...

further graphical parameters

Value

invisible(x)

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## load data
data("AirPollution", package = "lmSubsets")


#################
##  lmSubsets  ##
#################

lm_all <- lmSubsets(mortality ~ ., data = AirPollution, nbest = 5)
plot(lm_all)


################
##  lmSelect  ##
################

lm_best <- lmSelect(mortality ~ ., data = AirPollution, nbest = 20)
plot(lm_best)

lmSubsets documentation built on Feb. 8, 2021, 1:06 a.m.