Skip to contents

Introduction

Repeated measures analyses are used when multiple observations of the same endpoint are collected from each subject over time. This design provides insights into how responses evolve across visits and allows for within-subject correlation modeling.

In this example, we demonstrate how to integrate a custom repeated-measures analysis into East Horizon through R integration. The example focuses on a two-arm (treatment vs. control) continuous outcome trial.

In the R directory of this example you will find the following R file:

  1. Analyze.RepeatedMeasures.R - The R function named Analyze.RepeatedMeasures in the file is used to perform repeated measures analysis as described in Example 1 below.

Example 1 - Continuous Endpoint

This example demonstrates how to analyze a continuous repeated-measures endpoint within a two-arm clinical trial.

The preceding data generation step returns a list containing one response variable per visit: Response1, Response2, etc., each stored as a numeric vector. These responses are both outputs of the data generation step and inputs to the current analysis step. They can be accessed using the SimData object (a list-like data frame) via the $ operator, for example: SimData$Response1, SimData$Response2, etc.

The analysis is performed using the nlme::gls() model, which accounts for within-subject correlations across repeated visits and compares treatment effects using the model’s estimated parameters. The analysis automatically adapts for interim or final looks depending on the availability of LookInfo. As in other analysis integration examples, the decision logic uses helper functions (GetDecisionString() and GetDecision()) to determine whether efficacy or futility boundaries were crossed based on the computed test statistic.

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.