earth
models, but also for models built by
lm
,
glm
,
lda
,
etc.plotd(obj, hist = FALSE, type = NULL, nresponse = NULL, dichot = FALSE,
trace = FALSE, xlim = NULL, ylim = NULL, jitter = FALSE, main=NULL,
xlab = "Predicted Value", ylab = if(hist) "Count" else "Density",
lty = 1, col = c("grey70", 1, "lightblue", "brown", "pink", 2, 3, 4),
fill = if(hist) col[1] else 0,
breaks = "Sturges", labels = FALSE,
kernel = "gaussian", adjust = 1, zero.line = FALSE,
legend = TRUE, legend.names = NULL, legend.pos = NULL,
legend.cex = .8, legend.bg = "white", legend.extra = FALSE,
vline.col = 0, vline.thresh = .5, vline.lty = 1, vline.lwd = 1,
err.thresh = vline.thresh, err.col = 0, err.border = 0, err.lwd = 1,
xaxt = "s", yaxt = "s", xaxis.cex = 1, sd.thresh = 0.01, ...)
predict
.
Default is NULL
, meaning use a value suitable for the object
(actually "response"
for all objects except rpart
models, where NULL
, meaning use all columns of the predicted response.FALSE
separates tFALSE
.
Use TRUE
or 1
to trace plotd
---
useful to see how plotd
partitions the predicted response into classes.
Use 2
for a full dump of the internalNULL
means determine these limits automatically,
else specify c(xmin,xmax)
.NULL
means determine these limits automatically,
else specify c(ymin,ymax)
.FALSE
.
Specify TRUE
to automatically calculate the jitter,
else specify a numeric jitter value."string"
string
""
no title
NULL
(default) generate a title from the call."Predicted Value"
.if(hist) "Count" else "Density"
.hist=FALSE
, the default is 0, i.e., no fill.
For hist=TRUE
, the default is the first element in the col
argument.hist
.
Only used if hist=TRUE
.
Default is "Sturges"
.
When type="class"
, setting breaks
to a low number
can be used to widen the histTRUE
to draw counts on the hist
plot.
Only used if hist=TRUE
.
Default is FALSE
.density
.
Only used if hist=FALSE
.
Default is "gaussian"
.density
.
Only used if hist=FALSE
.
Default is 1
.plot.density
.
Only used if hist=FALSE
.
Default is FALSE
.TRUE
(default) to draw a legend, else FALSE
.NULL
means determine these automatically.NULL
means position the legend automatically,
else specify c(x,y)
.cex
for legend
.
Default is .8
.bg
color for legend
.
Default is "white"
.FALSE
.0.5
.
The vertical line is intended to indicate class separation.
If you use this, don't forget to set vline.col
.1
.1
.err.col
.
Default is vline.thresh
.0
, meaning no error shading.
This argument is ignored unless hist=FALSE
.
If there are more than two classes, err.col
0
, meaning no borders, else specify up to three colors.1
, else specify up to three line widths."s"
.
Use xaxt="n"
for no x axis."s"
.
Use yaxt="n"
for no y axis.hist=TRUE
and type="class"
.
Specify size of class labels drawn on the x axis.
Default is 1.0.01
.
Densities with a standard deviation less than sd.thresh
will not be plotted (a warning will be issued and the legend
will say "not plotte
density
, plot.density
hist
, plot.histogram
earth
, plot.earth
, plotmo
old.par <- par(no.readonly=TRUE);
par(mfrow=c(2,2), mar=c(4, 3, 1.7, 0.5), mgp=c(1.6, 0.6, 0), par(cex = 0.8))
data(etitanic)
fit <- earth(survived ~ ., data=etitanic, degree=2, glm=list(family=binomial))
plotd(fit)
plotd(fit, hist=TRUE, legend.pos=c(.25,220))
plotd(fit, hist=TRUE, type="class", labels=TRUE, xlab="", xaxis.cex=.8)
par(old.par)
Run the code above in your browser using DataLab