Learn R Programming

MachineShop (version 1.3.0)

calibration: Model Calibration

Description

Calculate calibration estimates from observed and predicted responses.

Usage

Calibration(...)

calibration(x, y = NULL, breaks = 10, span = 0.75, dist = NULL, na.rm = TRUE, ...)

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 predicted survival probabilities and with loess for others.

span

numeric parameter controlling the degree of loess smoothing.

dist

character string specifying a distribution with which to estimate observed survival means. Possible values are "empirical" for the Kaplan-Meier estimator, "exponential", "extreme", "gaussian", "loggaussian", "logistic", "loglogistic", "lognormal", "rayleigh", "t", or "weibull" (default).

na.rm

logical indicating whether to remove observed or predicted responses that are NA when calculating metrics.

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(times = 365 * c(2, 5, 10)))
cal <- calibration(res)
plot(cal)

# }

Run the code above in your browser using DataLab