simul_pfs {bonsaiforest}R Documentation

Simulation of Progression Free Survival Times

Description

Simulation of Progression Free Survival Times

Usage

simul_pfs(
  lp_aft,
  sigma_aft,
  recr_duration,
  rate_cens,
  n_events,
  add_uncensored_pfs = FALSE
)

Arguments

lp_aft

(numeric)
linear predictor values for the accelerate failure time model (AFT).

sigma_aft

(number)
standard deviation for the AFT model.

recr_duration

(number)
duration of recruitment.

rate_cens

(number)
rate for the exponentially distributed censoring process.

n_events

(count)
number of events to reach for the study end.

add_uncensored_pfs

(flag)
whether to add the uncensored PFS as well to the resulting data.frame.

Value

A data.frame with columns tt_pfs (PFS time) and ev_pfs (corresponding event indicator with 1 for an event and 0 for censored), and optionally tt_pfs_uncens.

Examples

set.seed(123)
simul_pfs(
  lp_aft = rnorm(100),
  sigma_aft = 1,
  recr_duration = 0.2,
  rate_cens = 2,
  n_events = 20
)

[Package bonsaiforest version 0.1.0 Index]