Skip to contents

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 required function signature for integration with East or East Horizon includes the SurvMethod, NumPrd, PrdTime, and SurvParam, which are ignored in this function, and only the parameters in UserParam are utilized.

Usage

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

Arguments

NumSub

The number of patient times to generate for the trial. This is a single numeric value, e.g., 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. The length of TreatmentID must be equal to NumSub.

NumPrd

Number of time periods that are provided.

UserParam

A list of user-defined parameters in East or East Horizon. The default is NULL. If UserParam is supplied, it must contain the following:

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.

Value

A list with the following components:

SurvivalTime

A vector of simulated survival times for patients.

ErrorCode

An integer error code (0 if no error, -1 if user parameters are missing).