R: Plot a varmod object (created by calling earth with the...

plot.varmod {earth} | R Documentation

## Plot a varmod object (created by calling earth with the varmod argument)

### 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' argument"), which = 1:4,
      do.par = NULL, info=FALSE,
      cex = NULL, caption = NULL,
      line.col = 2, min.sd.col = line.col,
      trace = 0, ...)

### 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 when building the `earth` model.
`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) model selection graph (only when `varmod.method="earth"` or `"x.earth"`).
`do.par` | Please see `plotres`
`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.
`line.col` | Color of lines in the plots. Default is `red`.
`min.sd.col` | Color of the `min.sd` dotted horizontal line. Default is `line.col`. Use `0` to not plot this line.
`trace,...` | Similar to `plotres`

### Note

The horizontal red dotted line in the first two plots shows the value of `min.sd`. See `earth`'s `varmod.clamp` argument.

### See Also

`varmod`

### Examples

    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)

[Package earth version 5.1.2 Index]