
2-Arm, Normal Outcome, Repeated Measures - Patient Simulation
Shubham Lahoti
June 04, 2025
2ArmNormalRepeatedMeasuresResponseGeneration.Rmd
These examples are related to the Integration Point: Response - Continuous Outcome with Repeated Measures. Click here for more information about this integration point.
Introduction
Repeated measures involve collecting multiple data points for the same variable from the same subjects across multiple time periods. This method provides insights into the subjects’ development and changes over time. In this context, a single subject can have multiple responses over time, and these responses can be correlated across different visits.
The following example illustrates how to integrate new patient outcome simulation (response) capabilities into East Horizon or East using R functions in the context of a two-arm trial with repeated measures.
Once CyneRgy is installed, you can load this example in RStudio with the following commands:
CyneRgy::RunExample( "2ArmNormalRepeatedMeasuresResponseGeneration" )
Running the command above will load the RStudio project in RStudio.
RStudio Project File: 2ArmNormalRepeatedMeasuresResponseGeneration.Rproj
In the R directory of this example you will find the following R files:
GenerateResponseDiffOfMeansRepeatedMeasures.R - The R function named GenRespDiffOfMeansRepMeasures in the file is used to generate the normal responses across multiple visits for 2-arm normal repeated measures design.
LibraryMASS.R - This file is used to load the library
MASS
to run themvrnorm
function.
Example 1 - Normal Endpoint
This example is related to this R file: GenerateResponseDiffOfMeansRepeatedMeasures.R
For a normal endpoint with repeated measures, the generation of
responses primarily depends on the mean and standard deviation across
all visits, as well as the correlation between these visits. This
examples uses built-in input variables coming from East Horizon or East
to simulate repeated measures data. It uses the
MASS::mvrnorm
function. This example does not use any
user-defined parameters.
The figure below illustrates where this example fits within the R integration points of Cytel products, accompanied by a flowchart outlining the general steps performed by the R code.