pw_exp_sim: Simulates time-to-event outcomes.

Description Usage Arguments Value Examples

View source: R/pw_exp.R

Description

Simulation of time-to-event outcomes using the piecewise constant hazard exponential function.

Usage

1
pw_exp_sim(hazard, n, maxtime = NULL, cutpoint = NULL)

Arguments

hazard

vector. The constant hazard rates for exponential failures.

n

scalar. The number of outcomes for simulation.

maxtime

scalar. maximum time before end of study.

cutpoint

vector. The change-point vector indicating time when the hazard rates change.

Value

a dataset with simulated follow-up time (time) and respective event indicator (1 = event, 0 = censoring)

Examples

1
2
pw_exp_sim(c(0.02, 0.01, 0.005), 100, 100, c(10, 20))
          pw_exp_sim(0.015, 100, 100)

bayesCT documentation built on July 2, 2020, 2:34 a.m.