Skip to contents

Simulate patient outcomes from a Weibull distribution.

Usage

SimulatePatientSurvivalWeibull(
  NumSub,
  NumArm,
  TreatmentID,
  SurvMethod,
  NumPrd,
  PrdTime,
  SurvParam,
  UserParam = NULL
)

Arguments

NumSub

The number of subjects that need to be simulated, integer value. NumSub survival times need to be generated for the trial. This is a single numeric value, eg 250.

NumArm

- The number of arms in the trial, a single numeric value. For a two arm trial, this will be 2.

TreatmentID

A vector of treatment ids, 0 = treatment 1, 1 = Treatment 2. length( TreatmentID ) = NumSub

SurvMethod

If SurvMethod is 1 (Hazard Rates): SurvParam is an array that specifies arm by arm hazard rates (one rate per arm per piece). Thus SurvParam [i, j] specifies hazard rate in ith period for jth arm. Arms are in columns with column 1 is control, column 2 is experimental Time periods are in rows If SurvMethod is 2: SurvParam is an array specifies arm by arm the Cum If SurvMethod is 3: SurvParam will be a 1 x 2 array with median survival times on each arms. Column 1 is control, column 2 is experimental

NumPrd

The number of periods in the East input.

PrdTime

TODO - Get this from East

SurvParam

- Depends on the table in the Response Generation tab. 2‐D array of parameters uses to generate time of events.

UserParam

A list of user defined parameters in East. The default must be NULL. If UserParam is supplied,

UserParam$dShapeCtrl

The shape parameter in the Weibull distribution for the control treatment

UserParam$dScaleCtrl

The scale parameter in the Weibull distribution for the control treatment

UserParam$dShapeExp

The shape parameter in the Weibull distribution for the experimental treatment

UserParam$dScaleExp

The scale parameter in the Weibull distribution for the experimental treatment

@description This function simulates patient data from a Weibull( shape, scale ) distribution. The rweibull function in the stats package is used to simulate the survival time. See help on rweibull. The exponential with mean = scale is a special case with the shape = 1 The required function signature for integration with East includes the SurvMethod, NumPrd, PrdTime and SurvParam which are ignored in this function and only the parameters in UserParam are utilized. @export