Skip to contents

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:

  1. 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.

  2. LibraryMASS.R - This file is used to load the library MASS to run the mvrnorm function.

Example 1 - Normal Endpoint

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.