simStudy: A function to simulate Survival data

Description Usage Arguments Examples

Description

This function simulates survival data with correlated time to progression and overall survival times.

Usage

1
2
3
4
5
6
simStudy(simid = 1, seed = 1234, rho = 0, p.switch = 0.25,
  prop.pd.int = 0, beta_1a = log(0.7), beta_1b = log(0.7),
  beta_2a = log(0.7), beta_2b = log(0.7), beta_pd = log(0.4),
  arm.n = 250, enroll.start = 0, enroll.end = 2, admin.censor = 3,
  os.gamma = 1.2, os.lambda = 0.3, ttp.gamma = 1.5, ttp.lambda = 2,
  include.metadata = FALSE)

Arguments

simid

Identifer added to simulated dataframe. Defaults to 1.

seed

Seed used for random number generator. Defaults to 1234.

rho

correlation coefficient between TTP and OS. Defaults to 0.

p.switch

proportion of patients who switch. Defaults to 0.25.

prop.pd.int

proportion of patients with PFS before switch allowed. Defaults to 0.

beta_1a

treatment effect (as log(Hazard Ratio)). Defaults to log(0.7).

beta_1b

treatment effect (as log(Hazard Ratio)). Defaults to log(0.7).

beta_2a

treatment effect (as log(Hazard Ratio)). Defaults to log(0.7).

beta_2b

treatment effect (as log(Hazard Ratio)). Defaults to log(0.7).

beta_pd

treatment effect on prog (as log(HR)). Defaults to log(0.4).

arm.n

patients per arm. Defaults to 250.

enroll.start

start of enrollment. Defaults to 0.

enroll.end

end of enrollment. Defaults to 2.

admin.censor

end of trial. Defaults to 3.

os.gamma

weibull shape - for OS. Defaults to 1.2.

os.lambda

weibull scale - for OS. Defaults to 0.3.

ttp.gamma

weibull shape - for TTP. Defaults to 1.5.

ttp.lambda

weibull scale - for TTP. Defaults to 2.

include.metadata

Should returned dataframe include simulation parameters. Defaults to False.

Examples

1
2
3
4
5
6
7
8
9
require(survival)
require(dplyr)

tst.df <- simStudy()
survfit(Surv(pfs.t, event = pfs.e) ~ x.trt, data = tst.df) %>%
  plot()

survfit(Surv(os.t, event = os.e) ~ x.trt, data = tst.df) %>%
  plot()

iain-t-bennett/SwitchPack documentation built on May 16, 2019, 11:07 a.m.