genpwedata: Generating function for Piece-wise Exponential Data.

Description Usage Arguments Value Examples

View source: R/PWECode.R

Description

genpwedata() function used mainly internally by pwetrialsimulator() function to generate data for a two-arm clinical trial, experimental and control groups. Can be used to generate random trial data.

Usage

1
genpwedata(sample_size, lambda_vec, hazard_ratio, time_vec, censor_value)

Arguments

sample_size

Number of subjects per arm.

lambda_vec

Set of lambdas passed to eha::rpch() through the levels parameter. Used only in control arm.

hazard_ratio

Desired Hazard Ratio between experimental and control groups.

time_vec

Set of cutpoints passed to eha::rpch() through the cuts parameter.

censor_value

Value at which time-to-event data are right censored.

Value

genpwedata() returns a data frame with columns: 'id', 'treatment', 'event_time', 'status', and 'indicator'.

Examples

1
2
3
4
5
6
7
nvalHC <- 60
time.vec <- c(0.3,0.9,1.5,2.1,2.4)
lambdaHC.vec <- c(0.19,0.35,0.56,0.47,0.38,0.34)
censor.value <- 3

SampleHistData <- genpwedata(nvalHC, lambdaHC.vec, 1.0, time.vec, censor.value)
SampleHistData

begglest/BayesCTDesign documentation built on Aug. 14, 2018, 4:31 a.m.