riskCalibrationPlot.default | R Documentation |
Calibration plot
## Default S3 method:
riskCalibrationPlot(
group,
pred,
rms.method = FALSE,
title = "Calibration plot",
show.oberved.ci = FALSE,
bins = 10,
color = "npg",
ticks.unit = 0.25,
full.range = TRUE,
smooth.method = "loess"
)
group |
Must be a TRUE/FALSE factor |
pred |
predicted probability |
rms.method |
If TRUE, use rms::val.prob function instead |
bins |
Number of bins. Default 20 |
color |
Default npg |
ticks.unit |
0.25 seq(0, 1, by = 0.25) |
full.range |
Default TRUE. loess smoothing between 0-1 or first bin to last bin |
smooth.method |
Smoothing method (function) to use, accepts either NULL or a character vector, e.g. "lm", "glm", "gam", "loess" or a function, e.g. MASS::rlm or mgcv::gam, stats::lm, or stats::loess. "auto" is also accepted for backwards compatibility. |
data(BreastCancer)
BreastCancer = BreastCancer[,-c(1)]
BreastCancer = na.omit(BreastCancer)
m <- glm(Class ~ ., data = BreastCancer, family = binomial)
BreastCancer$pred <- predict(m, type = "response")
riskCalibrationPlot(factor(BreastCancer$Class=="malignant", levels=c(FALSE, TRUE)),
BreastCancer$pred)
data(LIRI)
d1 <- LIRI[,-c(1,5)]
m <- glm(status ~ ., data = d1, family = binomial(logit))
d1$pred <- predict(m, type = "response")
loonR::riskCalibrationPlot(factor(LIRI$status), d1$pred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.