survplot_prc {pencal} | R Documentation |
Visualize survival predictions for a fitted PRC model
Description
Visualize survival predictions for a fitted PRC model
Usage
survplot_prc(step1, step2, step3, ids, tmax = 5, res = 0.01, lwd = 1,
lty = 1, legend.title = "Subject", legend.inset = -0.3,
legend.space = 1)
Arguments
step1 |
the output of |
step2 |
the output of |
step3 |
the output of |
ids |
a vector with the identifiers of the subjects to show in the plot |
tmax |
maximum prediction time to consider for the chart. Default is 5 |
res |
resolution at which to evaluate predictions for the chart. Default is 0.01 |
lwd |
line width |
lty |
line type |
legend.title |
legend title |
legend.inset |
moves legend more to the left / right (default is -0.3) |
legend.space |
interspace between lines in the legend (default is 1) |
Author(s)
Mirko Signorelli
References
Signorelli, M. (2024). pencal: an R Package for the Dynamic Prediction of Survival with Many Longitudinal Predictors. To appear in: The R Journal. Preprint: arXiv:2309.15600
Examples
# generate example data
simdata = simulate_prclmm_data(n = 100, p = 4, p.relev = 2,
t.values = c(0, 0.2, 0.5, 1, 1.5, 2),
landmark = 2, seed = 123)
# estimate the PRC-LMM model
y.names = paste('marker', 1:4, sep = '')
step1 = fit_lmms(y.names = y.names,
fixefs = ~ age, ranefs = ~ age | id,
long.data = simdata$long.data,
surv.data = simdata$surv.data,
t.from.base = t.from.base,
n.boots = 0)
step2 = summarize_lmms(object = step1)
step3 = fit_prclmm(object = step2, surv.data = simdata$surv.data,
baseline.covs = ~ baseline.age,
penalty = 'ridge')
# visualize the predicted survival for subjects 1, 3, 7 and 13
survplot_prc(step1, step2, step3, ids = c(1, 3, 7, 13), tmax = 6)
[Package pencal version 2.2.2 Index]