gce_calibration: Calibration of predicted vs. observed omega+ by risk rank

View source: R/calibration.R

gce_calibrationR Documentation

Calibration of predicted vs. observed omega+ by risk rank

Description

Groups subjects into equal-sized rank groups on the GCE risk score and compares the model-predicted quantity with an observed estimate in each group. For omega+ models (gcecox, gcefg) the predicted \omega^{+} (or \omega) is compared with observed cause-specific Nelson-Aalen cumulative hazards at time t: \omega^{+}_{obs} = H_1(t)/H_2(t) and \omega_{obs} = H_1(t)/(H_1(t)+H_2(t)). For a gcecif fit the predicted cumulative-incidence ratio \rho (or share \pi_1) is compared with the observed Aalen-Johansen cumulative incidence within the group: \rho_{obs} = F_1(t)/F_2(t) and \pi_{1,obs} = F_1(t)/(F_1(t)+F_2(t)). A calibration plot (predicted vs. observed with the identity line) and the underlying table are returned.

Usage

gce_calibration(object, which = NULL, groups = 5, t = NULL)

## S3 method for class 'gce_calibration'
print(x, digits = max(3L, getOption("digits") - 3L), ...)

## S3 method for class 'gce_calibration'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

## S3 method for class 'gce_calibration'
plot(x, ...)

Arguments

object

a "gcemod" object from gcecox, gcefg, or gcecif.

which

quantity to calibrate. For omega+ models "omegaplus" (default) or "omega"; for a gcecif fit "rho" (default) or "share". If NULL the model-appropriate default is used.

groups

number of rank groups (default 5).

t

time at which predicted and observed quantities are compared; defaults to the readout time of the fit. Fixed at the landmark time for a gcecif fit.

x

a "gce_calibration" object.

digits

number of significant digits to print.

...

unused.

row.names, optional

ignored; present for compatibility with the generic.

Value

An object of class "gce_calibration" with print, plot, and as.data.frame methods. Printing shows the calibration table (group, n, predicted, observed); plot draws predicted against observed with the identity line and returns the ggplot object invisibly.

Examples

data(hn)
fit <- gcecox(Surv(time, status) ~ age + t_cat + p16, data = hn, t = 5)
cal <- gce_calibration(fit, which = "omegaplus", groups = 5)
cal
plot(cal)

gcemod documentation built on Dec. 1, 2026, 1:06 a.m.