plot.lmSubsets {lmSubsets} | R Documentation |
Plot a subset regression
Description
Plot the deviance of the selected submodels, as well as a specified information criterion.
Usage
## 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 |
|
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
lmSubsets()
for all-subsets regressionlmSelect()
for best-subset regressionplot()
for the S3 generic
Examples
## 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)
[Package lmSubsets version 0.5-2 Index]