Title: Compare C-Statistics (Concordance) Between Survival Models
Version: 0.1.0
Description: Compare C-statistics (concordance statistics) between two survival models, using either bootstrap resampling (Harrell's C) or Uno's C with perturbation-resampling (from the survC1 package). Returns confidence intervals and a p-value for the difference in C-statistics. Useful for evaluating and comparing predictive performance of survival models. Methods implemented for Uno's C are described in Uno et al. (2011) <doi:10.1002/sim.4154>.
License: MIT + file LICENSE
Encoding: UTF-8
Depends: R (≥ 3.5.0)
Imports: boot
Suggests: survival, survC1
RoxygenNote: 7.3.2
URL: https://github.com/Lemonade0924/compareCstat
BugReports: https://github.com/Lemonade0924/compareCstat/issues
NeedsCompilation: no
Packaged: 2025-06-05 04:41:56 UTC; Ning
Author: Hairong Liu [aut], Ning Meng [aut, cre]
Maintainer: Ning Meng <nmeng2@jh.edu>
Repository: CRAN
Date/Publication: 2025-06-06 13:30:01 UTC

Compare C-statistics Between Two Models with Bootstrapped or Uno's C Confidence Intervals

Description

This function compares the C-statistics of two fitted models using either bootstrap resampling (Harrell's C) or Uno's C via perturbation-resampling (survC1 package).

Usage

compare_c_stat(
  model_raw,
  model_ext,
  data,
  R = 10,
  ci_type = "perc",
  method = "Harrell",
  tau = NULL
)

Arguments

model_raw

A fitted model (e.g., coxph) representing the base model.

model_ext

A fitted model (e.g., coxph) representing the extended model.

data

The dataset used for fitting the models.

R

Number of bootstrap or perturbation-resampling replications. Default is 100.

ci_type

Type of confidence interval to return ("perc", "norm", "basic", etc., for Harrell's C).

method

Which C-statistic to use: "Harrell" (default) or "Uno".

tau

Truncation time for Uno's C (default is max observed time in your data).

Value

A data frame showing C-statistics for each model, their confidence intervals, and the p-value for the difference.

References

Uno H, Cai T, Pencina MJ, D'Agostino RB, Wei LJ. (2011) On the C-statistics for evaluating overall adequacy of risk prediction procedures with censored survival data. Statistics in Medicine, 30(10):1105-1117. doi:10.1002/sim.4154

Examples

library(survival)
data(lung)
lung$status <- ifelse(lung$status == 2, 1, 0)
model1 <- coxph(Surv(time, status) ~ age, data = lung)
model2 <- coxph(Surv(time, status) ~ age + sex, data = lung)
compare_c_stat(model1, model2, data = lung, R = 10, method = "Harrell")
compare_c_stat(model1, model2, data = lung, R = 10, method = "Uno")
compare_c_stat(model1, model2, data = lung, R = 10, method = "Uno", tau = 365.25*2)