
Last chance! 50% off unlimited learning
Sale ends in
Calculate calibration estimates from observed and predicted responses.
calibration(
x,
y = NULL,
weights = NULL,
breaks = 10,
span = 0.75,
distr = character(),
na.rm = TRUE,
...
)
observed responses or resample result containing observed and predicted responses.
predicted responses if not contained in x
.
numeric vector of non-negative
case weights for the observed x
responses
[default: equal weights].
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 NULL
to fit smooth curves with splines for
predicted survival probabilities and with loess for
others.
numeric parameter controlling the degree of loess smoothing.
character string specifying a distribution with which to
estimate the observed survival mean. Possible values are
"empirical"
for the Kaplan-Meier estimator, "exponential"
,
"extreme"
, "gaussian"
, "loggaussian"
,
"logistic"
, "loglogistic"
, "lognormal"
,
"rayleigh"
, "t"
, or "weibull"
. Defaults to the
distribution that was used in predicting mean survival times.
logical indicating whether to remove observed or predicted
responses that are NA
when calculating metrics.
arguments passed to other methods.
Calibration
class object that inherits from data.frame
.
# NOT RUN {
## 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)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab