
Simulate TTE Patient Outcomes from a Weibull Distribution
SimulateTTEPatientWeibull.RdThis 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
SimulateTTEPatientWeibull(
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 ofTreatmentIDmust be equal toNumSub.- SurvMethod
This value is pulled from the Input Method drop-down list.
- 1
Hazard Rate.
- 2
Cumulative percentage survival.
- 3
Medians.
- NumPrd
Number of time periods that are provided.
- PrdTime
- If
SurvMethod = 1 PrdTimeis a vector of starting times of hazard pieces.- If
SurvMethod = 2 Times at which the cumulative percentage survivals are specified.
- If
SurvMethod = 3 PrdTimeis 0 by default.
- If
- SurvParam
A 2-D array of parameters to generate the survival times, depending on the table in the Response Generation tab.
- If
SurvMethod = 1 SurvParamis an array (NumPrdrows,NumArmcolumns) that specifies arm-by-arm hazard rates (one rate per arm per piece). Thus,SurvParam[i, j]specifies the hazard rate in theith period for thejth arm. Arms are in columns where column 1 is control and column 2 is experimental. Time periods are in rows, where row 1 is time period 1, row 2 is time period 2, etc.- If
SurvMethod = 2 SurvParamis an array (NumPrdrows,NumArmcolumns) that specifies arm-by-arm the cumulative percentage survivals (one value per arm per piece). Thus,SurvParam[i, j]specifies the cumulative percentage survivals in theith period for thejth arm.- If
SurvMethod = 3 SurvParamwill be a1 x 2array with median survival times for each arm. Column 1 is control, column 2 is experimental.
- If
- UserParam
A list of user-defined parameters. Must contain the following named elements:
UserParam$dShapeCtrlThe shape parameter in the Weibull distribution for the control treatment.
UserParam$dScaleCtrlThe scale parameter in the Weibull distribution for the control treatment.
UserParam$dShapeExpThe shape parameter in the Weibull distribution for the experimental treatment.
UserParam$dScaleExpThe scale parameter in the Weibull distribution for the experimental treatment.