survParamSim (version 0.1.6)

calc_km_pi: Generate Kaplan-Meier curves with prediction intervals from parametric bootstrap simulation

Description

Generate Kaplan-Meier curves with prediction intervals from parametric bootstrap simulation

Usage

calc_km_pi(
  sim,
  trt = NULL,
  group = NULL,
  pi.range = 0.95,
  calc.obs = TRUE,
  simtimelast = NULL,
  trt.assign = c("default", "reverse")
)

Arguments

sim

A survparamsim class object generated by surv_param_sim() function.

trt

An optional string to specify which column define treatment status. You will have survival curves with different colors in plot_km_pi() function.

group

Optional string(s) to specify grouping variable(s). You will have faceted survival curves for these variables in plot_km_pi() function.

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 newdata is dummy.

simtimelast

An optional numeric to specify last simulation time for survival curve. If NULL (default), the last observation time in the newdata will be used.

trt.assign

Specify which of the categories of trt need to be considered as control group. See details below if you have more than two categories. Only applicable if you will use extract_medsurv_delta_pi() to extract delta of median survival times.

Details

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.