
Last chance! 50% off unlimited learning
Sale ends in
An experimental diagnostic tool that plots the fitted values versus the
actual average values. Currently only available when
distribution = "bernoulli"
.
calibrate.plot(
y,
p,
distribution = "bernoulli",
replace = TRUE,
line.par = list(col = "black"),
shade.col = "lightyellow",
shade.density = NULL,
rug.par = list(side = 1),
xlab = "Predicted value",
ylab = "Observed average",
xlim = NULL,
ylim = NULL,
knots = NULL,
df = 6,
...
)
No return values.
The outcome 0-1 variable.
The predictions estimating E(y|x).
The loss function used in creating p
.
bernoulli
and poisson
are currently the only special options.
All others default to squared error assuming gaussian
.
Determines whether this plot will replace or overlay the
current plot. replace=FALSE
is useful for comparing the calibration
of several methods.
Graphics parameters for the line.
Color for shading the 2 SE region. shade.col=NA
implies no 2 SE region.
The density
parameter for polygon
.
Graphics parameters passed to rug
.
x-axis label corresponding to the predicted values.
y-axis label corresponding to the observed average.
x- and y-axis limits. If not specified te function will select limits.
These parameters are passed directly to
ns
for constructing a natural spline smoother for the
calibration curve.
Additional optional arguments to be passed onto
plot
Greg Ridgeway gregridgeway@gmail.com
Uses natural splines to estimate E(y|p). Well-calibrated predictions imply that E(y|p) = p. The plot also includes a pointwise 95
J.F. Yates (1982). "External correspondence: decomposition of the mean probability score," Organisational Behaviour and Human Performance 30:132-156.
D.J. Spiegelhalter (1986). "Probabilistic Prediction in Patient Management and Clinical Trials," Statistics in Medicine 5:421-433.
# Don't want R CMD check to think there is a dependency on rpart
# so comment out the example
#library(rpart)
#data(kyphosis)
#y <- as.numeric(kyphosis$Kyphosis)-1
#x <- kyphosis$Age
#glm1 <- glm(y~poly(x,2),family=binomial)
#p <- predict(glm1,type="response")
#calibrate.plot(y, p, xlim=c(0,0.6), ylim=c(0,0.6))
Run the code above in your browser using DataLab