Learn R Programming

MachineShop (version 1.1.0)

calibration: Model Calibration

Description

Calculate calibration estimates from observed and predicted responses.

Usage

Calibration(...)

calibration(x, y = NULL, breaks = 10, times = numeric(), ...)

Arguments

...

named or unnamed calibration output to combine together with the Calibration constructor.

x

observed responses or Resamples object of observed and predicted responses.

y

predicted responses.

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 NULL to fit smooth curves with splines for survival responses and loess for others.

times

numeric vector of follow-up times if y contains predicted survival events.

Value

Calibration class object that inherits from data.frame.

See Also

response, predict, resample, plot

Examples

Run this code
# NOT RUN {
library(survival)
library(MASS)

res <- resample(Surv(time, status != 2) ~ sex + age + year + thickness + ulcer,
                data = Melanoma, model = GBMModel,
                control = CVControl(surv_times = 365 * c(2, 5, 10)))
(cal <- calibration(res))
plot(cal)

# }

Run the code above in your browser using DataLab