Skip to contents

These metrics judge predicted cumulative incidences of one cause, with the other causes as competing events. Each uses the Kaplan-Meier estimate \(G\) of the censoring distribution, with an event of any cause ending follow-up.

Usage

brier_score_incidence(response, incidence_prob, times, cause)

integrated_brier_score_incidence(response, incidence_prob, times, cause)

concordance_index_incidence(response, incidence_prob, cause, tau = NULL)

calibration_incidence(response, incidence_prob, times, cause)

accuracy_in_time(response, incidence_probs, times)

Arguments

response

A competing-risks Surv() object, Surv(time, event) with event a factor whose first level means censored and whose other levels are the causes.

incidence_prob

The predicted cumulative incidence of cause. For concordance_index_incidence(), one value per subject (such as the incidence at a fixed time). Otherwise a matrix with one row per subject and one column per time.

times

The times, in the order of the columns of the predictions. The integrated score needs at least two, in increasing order.

cause

The cause, as a level of event or its number (1 for the first cause).

tau

The truncation time for concordance_index_incidence(). The default is the last event time of the cause.

incidence_probs

For accuracy_in_time(), an array of predicted cumulative incidences with dimensions subjects, causes (in the order of the levels), and times.

Value

A vector with one value per time, or a single number from integrated_brier_score_incidence() and concordance_index_incidence().

Details

brier_score_incidence() gives the weighted Brier score at each time, the mean of \(w_i (y_i - \hat F_i(t))^2\) where \(y_i\) is 1 for an event of the cause by \(t\). The weight is \(1 / G(T_i-)\) for an event of any cause by \(t\), \(1 / G(t-)\) for a subject still under observation after \(t\), and 0 for one censored by \(t\). integrated_brier_score_incidence() averages it over the times with the trapezoidal rule.

concordance_index_incidence() gives a weighted concordance for one cause. A case with an event of the cause at \(T_i \le \tau\) is compared with every subject whose time is later (with weight \(1 / G(T_i-)^2\)) and with every subject who had a competing event at or before \(T_i\) (with weight \(1 / (G(T_i-) G(T_j-))\)). Higher predicted incidence should go with the earlier event, and ties count as one half.

calibration_incidence() gives, at each time, the absolute difference between the mean predicted incidence and the Aalen-Johansen estimate for the whole sample.

accuracy_in_time() takes the predicted incidence of every cause. At each time it predicts each subject's outcome as the most likely of being event-free (one minus the sum of the incidences) and each cause, and gives the proportion predicted correctly among the subjects not censored by that time.

Examples

mgus <- data.frame(
  time = c(30, 45, 60, 72, 80, 95, 110, 120, 130, 150, 160, 180),
  status = c(1, 2, 0, 2, 1, 2, 0, 1, 2, 2, 0, 1),
  age = c(62, 75, 58, 80, 66, 71, 59, 64, 77, 82, 60, 68)
)
mgus$event <- factor(mgus$status, levels = 0:2, labels = c("censor", "pcm", "death"))
outcome <- Surv(mgus$time, mgus$event)

# The same predicted incidence for everyone: the Aalen-Johansen estimate
times <- c(50, 100, 150)
aj <- predict(aalen_johansen(Surv(time, event) ~ 1, data = mgus), times = times)
pcm <- aj$estimate[aj$cause == "pcm"]
probs <- matrix(pcm, nrow = nrow(mgus), ncol = length(times), byrow = TRUE)

brier_score_incidence(outcome, incidence_prob = probs, times = times, cause = "pcm")
#> [1] 0.07638889 0.14497599 0.20464678
calibration_incidence(outcome, incidence_prob = probs, times = times, cause = "pcm")
#> [1] 0 0 0

# A score that rises with age
concordance_index_incidence(outcome, incidence_prob = mgus$age / 100, cause = "death")
#> [1] 0.8297398