calc_ave_km_pi | R Documentation |
Generate Kaplan-Meier curves with prediction intervals using simulated survival time
calc_ave_km_pi(
sim,
trt = NULL,
group = NULL,
pi.range = 0.95,
calc.obs = TRUE,
simtimelast = NULL,
trt.assign = c("default", "reverse"),
boot.subj = TRUE,
calc.median.surv = FALSE
)
calc_km_pi(
sim,
trt = NULL,
group = NULL,
pi.range = 0.95,
calc.obs = TRUE,
simtimelast = NULL,
trt.assign = c("default", "reverse")
)
sim |
A |
trt |
An optional string to specify which column define treatment status.
You will have survival curves with different colors in |
group |
Optional string(s) to specify grouping variable(s).
You will have faceted survival curves for these variables in |
pi.range |
Prediction interval for simulated survival curves. |
calc.obs |
A logical to specify whether KM estimates will be performed
for the observed data. Need be set as FALSE if survival information in the |
simtimelast |
An optional numeric to specify last simulation time for survival curve.
If NULL (default), the last observation time in the |
trt.assign |
Specify which of the categories of |
boot.subj |
Boolean to specify whether bootstrapping of subjects are performed before calculating HR. Default TRUE. |
calc.median.surv |
Whether to calculate median survival time for
|
calc_km_pi()
calculate survival profile using the simulated survival times with
Kaplan-Meier estimates, while calc_ave_km_pi()
calculate "average" survival
using the mean survival function per treatment groups. calc_ave_km_pi()
actually
does not rely on Kaplan-Meier estimates as it directly uses the underlying
parametric survival model, however the function has km
for naming consistency.
If your trt
has more than two categories/levels and want to specify which one to use as a
reference group, you can convert the column into a factor in the newdata
input for
surv_param_sim()
. The first level will be used as a reference group.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.