Learn R Programming

earth (version 4.1.0)

plot.varmod: Plot a varmod object

Description

Plot a variance model (a varmod object). Typically you call this function for a variance model embedded in an earth model.

Usage

## S3 method for class 'varmod':
plot(x = stop("no 'x' arg"), which = 1:4,
  do.par = length(which) > 1, info=FALSE,
  cex = NULL, caption = if(do.par) NULL else "", main = NULL,
  col.line = "lightblue", col.min.sd = col.line, ...)

Arguments

x
A varmod object. Typically this is embedded in a parent earth object, and so you invoke this function with plot(earth.mod$varmod). The varmod.method argument must have been specified
which
Which plots to plot. Default is 1:4 meaning all. The term parent below refers to the earth model in which the varmod is embedded. 1) fitted vs parent fitted 2) fitted vs parent first predictor 3) residuals vs fitted 4
do.par
Call par() for global settings as appropriate. Default is TRUE, Set to FALSE if you want to append figures to an existing plot.
info
Plot some additional information, including lowess fits in the first two plots.
cex
Character expansion.
caption
Default is NULL, meaning automatically generate an overall caption.
main
Default is NULL, meaning automatically generate a title for each graph.
col.line
Color of lines in the plots. Default is lightblue.
col.min.sd
Color of the min.sd dotted horizontal line. Default is col.line. Use 0 to not plot this line.
...
Unused, but provided for generic/method consistency.

See Also

varmod

Examples

Run this code
data(ozone1)

set.seed(1) # optional, for cross validation reproducibility

# note: should really use ncross=30 below but for a quick demo we don't

earth.mod <- earth(O3~temp, data=ozone1, nfold=10, ncross=3, varmod.method="lm")

plot(earth.mod$varmod) # plot the embedded variance model (this calls plot.varmod)

Run the code above in your browser using DataLab