View source: R/pa_survival_eval.R
| pa_summarize | R Documentation |
Calls pa_survival_eval() for each model in a named list and
outputs a wide table: each row corresponds to one metric and each column
corresponds to a model.
pa_summarize(
models,
metrics = NULL,
t_star = NULL,
tau = 1e+11,
digits = 2,
calibration_args = list()
)
models |
A **named list** in which each element corresponds to a fitted model. Each model entry must itself be a list containing:
Note: If |
metrics |
Optional character vector of metrics to compute (passed through). |
t_star |
Optional evaluation time for point metrics and calibration. Defaults to the median observed follow-up. |
tau |
Optional numeric scalar, specify the max time horizon for R2 measure and concordance measure (default = 10e10). |
digits |
Number of decimal places to round the metric values (default = 2). |
calibration_args |
Optional named list passed to [pa_calibration()]. |
A data frame with:
Each row = metric
Each column = model name
Cell values = corresponding rounded metric values
d <- pa_sim_cox_weibull(n = 150, pi_c = 0.3, v = 2,
beta = c(0.5, -0.5), seed = 2025)
d <- d[, c("time", "status", "x1", "x2")]
fit <- survival::coxph(survival::Surv(time, status) ~ x1 + x2,
data = d, x = TRUE, y = TRUE)
pred <- pa_predict_coxph(model = fit, covs = c("x1", "x2"), new_data = d)
# one column per model, metrics down the rows
pa_summarize(list(cox = pred))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.