earth
object.
By default the plot shows model selection, cumulative distribution
of the residuals, residuals versus fitted values, and the residual QQ plot.This function calls plotres
internally.
The first arguments are identical to plotres
.
"plot"(x = stop("no 'x' argument"),
# the following are identical to plotres arguments
which = 1:4, info = FALSE, versus = 1, standardize = FALSE, delever = FALSE, level = 0, id.n = 3, labels.id = NULL, smooth.col = 2, grid.col = 0, jitter = 0, do.par = NULL, caption = NULL, trace = 0, npoints = 3000, center = TRUE, type = NULL, nresponse = NA,
# the following are earth specific
col.cv = "lightblue", col.grsq = 1, col.rsq = 2, col.infold.rsq = 0, col.mean.infold.rsq = 0, col.mean.oof.rsq = "palevioletred", col.npreds = if(is.null(object$cv.oof.rsq.tab)) 1 else 0, col.oof.labs = 0, col.oof.rsq = "mistyrose2", col.oof.vline = col.mean.oof.rsq, col.pch.cv.rsq = 0, col.pch.max.oof.rsq = 0, col.vline = col.grsq, col.vseg = 0, lty.grsq = 1, lty.npreds = 2, lty.rsq = 5, lty.vline = "12", legend.pos = NULL, ...)
earth_plotmodsel( # for internal use by plotres x, col.rsq = 2, col.grsq = 1, col.infold.rsq = 0, col.mean.infold.rsq = 0, col.mean.oof.rsq = "palevioletred", col.npreds = NULL, col.oof.labs = 0, col.oof.rsq = "mistyrose2", col.oof.vline = col.mean.oof.rsq, col.pch.cv.rsq = 0, col.pch.max.oof.rsq = 0, col.vline = col.grsq, col.vseg = 0, lty.grsq = 1, lty.npreds = 2, lty.rsq = 5, lty.vline = "12", legend.pos=NULL, add = FALSE, jitter = 0, max.nterms = length(object$rss.per.subset), max.npreds=max(1,get.nused.preds.per.subset(object$dirs,object$prune.terms)), ...)
"lightblue"
.
Color of cross validation line in the residuals plot.
This is the residual of the mean out-fold-predicted value.The following arguments are for the model selection plot.
1
.
Color of GRSq line in the Model Selection plot.
Use 0
for no GRSq line.
2
.
Color of the RSq line in the Model Selection plot.
Use 0
for no RSq line.
nfold
and keepxy
were used
in the original call to earth
.
Default is 0
, lines not plotted.
0
, line not plotted.
Applies only if nfold
and keepxy
were used
in the original call to earth
.
"palevioletred"
.
Color of mean out-of-fold RSq for each number of terms in the Model Selection plot.
Applies only if nfold
and keepxy
were used
in the original call to earth
.
Use 0
to not plot this line.
oof.rsq
's are displayed.
Use 0
for no "number of predictors" plot.
oof.rsq
lines.
Default is 0
, no labels.
nfold
and keepxy
were used
in the original call to earth
.
Default is "mistyrose2"
, a pale pink.
Use 0
to not plot these lines.
May be a vector of colors, which will be recycled if necessary.
oof.rsq
in the Model Selection plot.
Default is col.mean.oof.rsq
.
oof.rsq
line to indicate the cv.rsq
.
for that fold
(i.e., it is plotted at the number of terms selected by the in-fold GCV).
Default is 0
, point not plotted.
oof.rsq
line to indicate the
maximum oof.rsq
for that fold.
Default is 0
, point not plotted.
col.grsq
.
This will be at the maximum GRSq unless pmethod="none"
.
Use 0
for no vertical line.
0
.
Color of triangular marker at top of vertical line for best GRSq.
1
2
.
5
.
"12"
.
NULL
meaning automatic.
Use legend.pos=NA
or 0
for no legend.
earth_plotmodsel
arguments for internal use by
plotres
.plotres
for the details
on the dots arguments.The ylim
argument is treated specially in the model selection plot:
ymin
equal to -1
means use
the smallest GRSq or RSq value, excluding the intercept,
and ymax
equal -1
means use
the largest GRSq or RSq value.
earth
,
plot.earth.models
,
plotd
,
plotmo
data(ozone1)
earth.mod <- earth(O3 ~ ., data = ozone1, degree = 2)
plot(earth.mod)
Run the code above in your browser using DataLab