genpwedata {BayesCTDesign} | R Documentation |
Generating function for Piece-wise Exponential Data.
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
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 |
hazard_ratio |
Desired Hazard Ratio between experimental and control groups. |
time_vec |
Set of cutpoints passed to |
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
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
[Package BayesCTDesign version 0.6.1 Index]