
2-Arm, Single Endpoint - Simulate Patient Dropout
Shubham Lahoti
January 16, 2025
PatientDropout.Rmd
Introduction
For all examples, we assume the trial design consist of control and an experimental treatment. Patients may dropout of a trial for a variety of reasons such as safety issues, treatment burden or other non-trial related issues. The dropout rate can be as high as 30% in some trials if the drug has adverse side effects. The introduction of dropout probabilities or dropout hazard rate plays a significant role during data generation that can be further utilized during the analysis.
Once CyneRgy is installed, you can load this example in RStudio with the following commands:
CyneRgy::RunExample( "2ArmPatientDropout" )
Running the command above will load the RStudio project in RStudio.
RStudio Project File: 2ArmPatientDropout.Rproj
In the R directory of this example you will find the following R files:
GenerateCensoringUsingBinomialProportion.R - Contains a function named GenerateCensoringUsingBinomialProportion to demonstrate the R code necessary for Example 1 as described below.
GenerateDropoutTimeForSurvival.R - Contains a function named GenDropoutTimeForSurvival to demonstrate the R code necessary for Example 2 as described below.
Example 1 - Dropout Using Binomial Proportion
The R function named “GenerateCensoringUsingBinomialProportion” in the file generates the censor ID using the same dropout probability for both treatment using rbinom(). In this case, the Dropout probability is a common value across both treatments.
Steps:
- Let pd = Dropout probability.
- Draw a random sample from Bernoulli distribution with p = 1 - pd, i.e., Binomial(1, pd) of a size n = NumSub.
- The sample generated in step (2) is a censoring indicator where 1 is a patient that does NOT drop out, e.g., completer, and 0 for a patient that drops out, e.g., non-completer.
Example 2 - Dropout Time For Survival
The function named “GenDropoutTimeForSurvival” generates dropout time for 2-arm survival design. In this cases, there is an option to provide a dropout information for each arm which then is utilized to generate dropout times for each arm from Exponential distribution. We fix Number of periods = 1 and Dropout distribution = Exponential.