Skip to contents

Introduction

This document provides an overview of the R examples provided in this directory. Each example is included in a directory that provides:

  • an RStudio project file,
  • a Description file that describes the example,
  • an R folder which contains the example R scripts,
  • optional: a FillInTheBlankR folder which contains the worked examples with various code deleted so you can practice and fill in the blanks.

The following examples are included:

Enrollment

Generate Patient Arrival Times with Poisson Process This example demonstrates how to add the ability to generate patient arrival times according to a Poisson process with a ramp-up by customizing the Enrollment integration point of East Horizon.
Click here to view the full example.

Randomization

2-Arm - Randomization of Subjects This example illustrates three ways to customize how subjects are assigned to treatment arms in East Horizon: using a uniform distribution, using the sample() function, and using the randomizeR package. Click here to view the full example.

Dropout

2-Arm, Single Endpoint - Simulate Patient Dropout This example illustrates how to customize the dropout distribution in East Horizon for continuous and binary outcomes, time-to-event outcome, and continuous outcome with repeated measures. Click here to view the full example.

Descriptions for the Multiple Arm examples are not available yet, but the examples can be found in this folder.


Response (Patient Simulation)

2-Arm, Continuous Outcome – Patient Simulation This example demonstrates two ways to customize the patient outcome simulation in East Horizon for a two-arm trial with a continuous outcome: using a mixture distribution, with or without the mixture proportion sampled from a Beta distribution.
Click here to view the full example.
2-Arm, Time-To-Event Outcome – Patient Simulation This example demonstrates two ways to customize the patient outcome simulation in East Horizon for a two-arm trial with a time-to-event outcome: using a Weibull distribution, and using a mixture of exponential distributions. Click here to view the full example.
2-Arm, Binary Outcome – Patient Simulation This example demonstrates two ways to customize the patient outcome simulation in East Horizon for a two-arm trial with a binary outcome: using a mixture distribution, with or without the mixture proportion sampled from a Beta distribution. Click here to view the full example.
2-Arm, Continuous Outcome, Repeated Measures – Patient Simulation This example demonstrates how to customize the patient outcome simulation in East Horizon for a two-arm trial with a continuous outcome with repeated measures using the MASS::mvrnorm() function. Click here to view the full example.
Childhood Anxiety Trial This example covers a specific situation where the patient data simulation needs to be customized to match what is expected in a clinical trial in childhood anxiety.
Click here to view the full example.

Descriptions for the Multiple Arm examples are not available yet, but the examples can be found in this folder. Similarly, examples for Dual Endpoints can be found in this folder.


Analysis (Test Statistic)

2-Arm, Continuous Outcome – Analysis This example demonstrates three ways to customize the statistical test in East Horizon for a two-arm trial with a continuous outcome: using a formula from the East manual, using the t.test() function, and using confidence interval limits for Go/No-Go decision-making. Click here to view the full example.
2-Arm, Time-To-Event Outcome – Analysis This example demonstrates three ways to customize the statistical test in East Horizon for a two-arm trial with a time-to-event outcome: using formulas from the East manual, using the survival::survdiff() function, and using confidence interval limits for Go/No-Go decision-making. Click here to view the full example.
2-Arm, Binary Outcome – Analysis This example demonstrates four ways to customize the statistical test in East Horizon for a two-arm trial with a binary outcome: using a formula from the East manual, using the prop.test() function, using confidence interval limits for Go/No-Go decision-making, and using a Bayesian Beta-Binomial model. Click here to view the full example.
Time-To-Event Weighted Conditional Power Futility Analysis This example demonstrates how to customize the statistical test in East Horizon for a two-arm trial with a time-to-event outcome using conditional power and futility boundaries based on the Logrank test. Click here to view the full example.

Descriptions for the Multiple Arm examples are not available yet, but the examples can be found in this folder. Similarly, examples for Dual Endpoints can be found in this folder.


Treatment Selection

Multiple Arm, Binary Outcome - Treatment Selection This example demonstrates four ways to customize the treatment selection in East Horizon for a multiple arm trial: based on response rates, based on p-value, based on number of responses, and based on Bayesian posterior probabilities. Click here to view the full example.

Advanced Examples

These examples use more than one integration point in the same project to achieve a more complex design option.

Bayesian Assurance, Continuous Outcome This example demonstrates the computation of Bayesian assurance, or probability of success, using a mixture of normal distribution priors featuring a two-arm trial with continuous outcome.
Click here to view the full example.
Bayesian Assurance, Time-to-Event Outcome This example demonstrates the computation of Bayesian assurance, or probability of success, using a bi-modal distribution prior featuring a two-arm trial with time-to-event outcome.
Click here to view the full example.
Consecutive Studies, Binary Outcome This example demonstrates the computation of conditional probability of success in consecutive studies. It features a sequential design involving a Phase 2 trial followed by a Phase 3 trial, both with a binary outcome Phase 2 results are saved and then used as the prior for Phase 3, allowing Phase 3 patient outcomes to be generated conditional on Phase 2 success.
Click here to view the full example.
Consecutive Studies, Continuous Outcome This example demonstrates the computation of Bayesian assurance, or probability of success, in consecutive studies: a Phase 2 trial followed by a Phase 3 trial, both with continuous outcome. The objective is to understand how conducting a Phase 2 study can reduce the risk associated with the Phase 3 trial.
Click here to view the full example.
Consecutive Studies, Continuous & Time-to-Event Outcomes This example demonstrates the computation of Bayesian assurance, or probability of success, in consecutive studies: a Phase 2 trial with continuous outcome followed by a Phase 3 trial with time-to-event outcome. The objective is to understand how conducting a Phase 2 study can reduce the risk associated with the Phase 3 trial. This example also includes a step to load the Phase 2 output and extract the true treatment differences.
Click here to view the full example.
Probability of Success, Dual Endpoints This example demonstrates how to compute the probability of success of a trial and extend East Horizon’s single-endpoint framework to handle dual endpoints (Progression-Free Survival and Overall Survival) using custom R scripts for the Analysis and Response integration points.
Click here to view the full example.
Multiple Endpoints With Covariates and Stratified Randomization This example demonstrates how to integrate patient outcome simulation and analysis functionality for multiple independent continuous outcomes into East Horizon, across three cases: multiple endpoints using a t-test, multiple endpoints with covariates using ANCOVA, and multiple endpoints with covariates and stratified randomization. Click here to view the full example.
Schizophrenia Trial (MMRM Analysis) This example demonstrates how to simulate and analyze data using a Mixed Model for Repeated Measures (MMRM) approach in the context of a schizophrenia trial. Click here to view the full example.