calibration | R Documentation |
Calculate calibration estimates from observed and predicted responses.
calibration(
x,
y = NULL,
weights = NULL,
breaks = 10,
span = 0.75,
distr = character(),
pool = FALSE,
na.rm = TRUE,
...
)
x |
observed responses or resample result containing observed and predicted responses. |
y |
predicted responses if not contained in |
weights |
numeric vector of non-negative
case weights for the observed |
breaks |
value defining the response variable bins within which to
calculate observed mean values. May be specified as a number of bins, a
vector of breakpoints, or |
span |
numeric parameter controlling the degree of loess smoothing. |
distr |
character string specifying a distribution with which to
estimate the observed survival mean. Possible values are
|
pool |
logical indicating whether to compute a single calibration curve
on predictions pooled over all resampling iterations or to compute them for
each iteration individually and return the mean calibration curve. Pooling
can result in large memory allocation errors when fitting smooth curves
with |
na.rm |
logical indicating whether to remove observed or predicted
responses that are |
... |
arguments passed to other methods. |
Calibration
class object that inherits from data.frame
.
c
, plot
## Requires prior installation of suggested package gbm to run
library(survival)
control <- CVControl() %>% set_predict(times = c(90, 180, 360))
res <- resample(Surv(time, status) ~ ., data = veteran, model = GBMModel,
control = control)
cal <- calibration(res)
plot(cal)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.