HSCI 410 — Lesson 11

Repeated Measures Data

Exploratory Data Analysis For Epidemiology

Kiffer G. Card, PhD, Faculty of Health Sciences, Simon Fraser University

Learning objectives for this lesson:

  • Recognize and describe the unique characteristics of repeated measures data structures
  • Use descriptive and graphical tools to explore repeated measures datasets
  • Apply simple univariate approaches (separate time point analyses, summary statistics) to analyze repeated measures
  • Understand the limitations of random-intercept mixed models for repeated measures and why correlation structures matter
  • Choose among correlation structures (compound symmetry, AR(1), ARMA(1,1), Toeplitz, unstructured) for repeated measures
  • Apply linear mixed models with appropriate correlation structures to repeated measures data
  • Understand trend models with random slopes for time
  • Describe the challenges of extending GLMMs to discrete repeated measures data including transition models
  • Use GEE procedures to analyze clustered and repeated measures data

This course was developed by Kiffer G. Card, PhD, as a companion to Dohoo, I. R., Martin, S. W., & Stryhn, H. (2012). Methods in Epidemiologic Research. VER Inc.

Section 1

Introduction & Descriptive Approaches

⏱ Estimated time: 15 minutes

What Are Repeated Measures?

Repeated measures data arise when multiple measurements are taken over time on the same subjects. This is one of the most common data structures in health sciences research—think of clinical trials where patients are measured at baseline and multiple follow-up visits, or cohort studies that track health outcomes over years.

Longitudinal studies (which collect repeated measures) differ fundamentally from cross-sectional studies, which measure each subject only once. The key advantage of longitudinal designs is their ability to assess within-subject change over time, making them more powerful for detecting the effects of within-subject predictors.

Why Repeated Measures Require Special Methods

In repeated measures data, observations within the same subject are not independent. Moreover, the time ordering of measurements introduces autocorrelation—measurements closer in time tend to be more strongly correlated than those further apart. This temporal structure means that a simple hierarchical (random intercept) model, which assumes all within-subject correlations are equal, may be inadequate. Special methods are needed to properly account for the pattern of correlations.

Key Terminology

Balanced
Click to learn more
📅
Uniform
Click to learn more
📏
Equidistant
Click to learn more
🔁
Autocorrelation
Click to learn more

Missing Data and Drop-Outs

Missing data is very common in repeated measures studies. Subjects may miss individual visits (intermittent missingness) or drop out permanently (monotone missingness). The pattern and mechanism of missingness can substantially affect the validity of the analysis. Methods that can handle unbalanced data (such as mixed models and GEE) are therefore particularly valuable for repeated measures.

Descriptive Approaches

Profile Plots

Profile plots (also called spaghetti plots) display each subject's trajectory over time. They reveal patterns of tracking (whether subjects maintain their relative positions), overall trends, and variability. These plots are essential for understanding the data before fitting any model.

Mean Plots

Mean plots show the average outcome at each time point, often separated by treatment group. They summarize the overall trend but hide individual variability. Mean plots are useful for visualizing treatment effects over time and identifying non-linear trends.

Correlation and Covariance Matrices

Examining the correlation matrix of measurements across time points reveals the autocorrelation pattern. If correlations decrease with increasing time distance, an AR(1)-type structure may be appropriate. If correlations are roughly equal, compound symmetry may suffice. The covariance matrix additionally reveals whether variances change over time.

Data Format: Long vs. Wide

Repeated measures data can be stored in wide format (one row per subject, separate columns for each time point) or long format (one row per measurement, with a time variable). Most modern statistical software requires long format for mixed models and GEE. Wide format is needed for MANOVA approaches.

Example: Clinical Trial with Repeated Blood Pressure Measurements

Consider a clinical trial where 100 patients are randomized to treatment or placebo, with blood pressure measured at baseline and months 1, 3, 6, and 12. This is a balanced (5 measurements per subject), uniform (same time points), but not equidistant (spacing varies: 1, 2, 3, and 6 months) design. Profile plots reveal that patients’ blood pressures track over time, and the correlation matrix shows correlations declining from 0.80 (adjacent visits) to 0.45 (baseline vs. month 12)—clear evidence of autocorrelation.

Section 1 Knowledge Check

1. What distinguishes repeated measures data from standard clustered data?

While repeated measures are a type of clustered data (measurements within subjects), the time ordering introduces autocorrelation — measurements closer in time are more correlated — which standard hierarchical models don’t capture.

2. A balanced repeated measures design means:

A balanced design has the same number of measurements per subject, taken at the same time points. This is the most regular data structure and allows the widest range of analytical approaches.

3. Autocorrelation in repeated measures means:

Autocorrelation refers to the pattern where the correlation between measurements decreases as the time gap between them increases, which is a natural feature of longitudinal data.

Reflection

Think of a longitudinal study in health sciences. What types of missing data patterns might occur, and how could they affect the validity of your analysis?

Reflection saved!
* Complete the quiz and reflection to continue.
Section 2

Univariate & Multivariate Approaches

⏱ Estimated time: 20 minutes

Simple Approaches to Repeated Measures

Before turning to complex mixed models, it is worth understanding the simpler methods that have traditionally been used for repeated measures data. These methods either reduce the data to avoid modelling correlations altogether, or make strong assumptions about the correlation structure.

Separate Time Point Analysis

The simplest approach is to analyze each time point independently—for example, running a separate t-test or regression at each visit. This is straightforward but wasteful: it ignores the within-subject correlations and creates a multiple testing problem. If there are m time points, a Bonferroni correction divides α by m, which can be very conservative.

Summary Statistics Approach

A more elegant simple approach is to compute a single summary value per subject—such as the slope of their trajectory, the drop from first to last measurement, or the area under the curve (AUC)—and then perform a standard between-subjects analysis on these summaries.

Advantages: Simple, robust to model assumptions about correlation structure, and easy to interpret.

Disadvantages: Loss of information about the temporal pattern, difficulty incorporating within-subject time-varying predictors, and potential loss of power.

Repeated Measures ANOVA

Repeated measures ANOVA treats time as a within-subject factor and tests for differences across time points. However, it assumes compound symmetry—that all pairs of time points have the same correlation. This is the same assumption as a random intercept model.

When compound symmetry is violated (which is common with autocorrelated data), the F-test becomes liberal (anti-conservative). The Huyhn-Feldt correction factor (ε) adjusts the degrees of freedom to account for this violation. When ε = 1, compound symmetry holds perfectly; as ε decreases, the violation is more severe.

MANOVA (Multivariate Analysis of Variance)

MANOVA treats the entire vector of repeated measurements as a multivariate outcome, making no assumptions about the correlation structure. This is its key advantage over repeated measures ANOVA.

Limitations: Requires completely balanced data with no missing values, cannot easily handle within-subject continuous predictors, and uses wide-format data. It also becomes impractical with many time points.

Covariance and Correlation Matrices

Covariance Matrix (Eq 23.1)
Σ = Cov(Yi) — an m × m matrix of variances and covariances across time points
Correlation Matrix (Eq 23.2)
R = Corr(Yi) — standardised version with 1s on the diagonal and correlations off-diagonal
Limitations of Each Approach

Separate time points: Multiple testing, ignores correlations, wasteful of information. Summary statistics: Loses temporal detail, cannot incorporate time-varying covariates. RM ANOVA: Assumes compound symmetry, which is rarely true. MANOVA: Requires complete, balanced data with no missing values. All of these limitations motivate the use of mixed models with flexible correlation structures.

ApproachHandles Missing Data?Assumes Equal Correlations?Time-Varying Covariates?
Separate Time PointsYes (per time point)N/A (ignores structure)Yes
Summary StatisticsPartiallyNoNo
RM ANOVANoYes (compound symmetry)No
MANOVANoNoNo
Mixed ModelsYesFlexibleYes

Section 2 Knowledge Check

1. The summary statistic approach involves:

The summary statistic approach reduces each subject’s series to one number (e.g., slope, AUC, drop from first to last) and performs a standard between-subjects analysis, avoiding the need to model within-subject correlations.

2. Repeated measures ANOVA assumes:

Repeated measures ANOVA assumes compound symmetry, meaning all pairs of measurements have the same correlation. This is the same assumption as a random intercept model, and violations can lead to liberal (anti-conservative) test statistics.

3. An advantage of MANOVA over repeated measures ANOVA for repeated measures is:

MANOVA treats the entire observation vector as multivariate, making no assumptions about the structure of the covariance matrix. However, it requires balanced data with no missing values and cannot easily handle within-subject continuous predictors.

Reflection

When would you choose a simple summary statistic approach over a mixed model for repeated measures data? What information might you lose by simplifying the analysis in this way?

Reflection saved!
* Complete the quiz and reflection to continue.
Section 3

Linear Mixed Models with Correlation Structure

⏱ Estimated time: 20 minutes

Beyond Random Intercepts

A random intercept model assumes compound symmetry—that all pairs of measurements on the same subject are equally correlated. For most repeated measures data, this assumption is violated because of autocorrelation. We need to extend the mixed model to include explicit correlation structures for the error term ε.

Choosing a Correlation Structure

The choice of correlation structure is one of the most important decisions in repeated measures analysis. Start by examining the empirical correlation matrix. If correlations clearly decay with increasing time lag, consider AR(1) or ARMA(1,1). If the decay is minimal, compound symmetry may suffice. If the pattern is complex, consider Toeplitz or unstructured. Use AIC to compare non-nested structures and likelihood ratio tests for nested ones.

Key Correlation Structures

Compound Symmetry (Exchangeable)

All pairs of measurements have the same correlation ρ, regardless of how far apart in time they are. This is the simplest structure and is equivalent to a random intercept model. It has only 1 correlation parameter.

When appropriate: When there is no autocorrelation—i.e., the correlation between measurements does not depend on time distance. This is rare in practice for true repeated measures data.

First-Order Autoregressive — AR(1)

Correlations decay as powers of ρ with increasing time distance: Corr(Yj, Yk) = ρ|j−k|. This produces an exponential decay pattern. It has only 1 parameter (ρ) and is a good default for equally spaced repeated measures.

When appropriate: When the correlation matrix shows a clear pattern of decreasing correlations with increasing time lag, and the decay appears approximately geometric.

ARMA(1,1)

An extension of AR(1) that allows a slower or more flexible decay in correlations. It has 2 parameters and can accommodate patterns where the initial drop in correlation is steep but then levels off.

Toeplitz (Stationary)

Each lag has its own unconstrained correlation. For m time points, there are m − 1 correlation parameters. The structure is “banded”—the correlation depends only on the time lag, not on which specific time points are involved.

When appropriate: When the pattern of decay is irregular and cannot be well approximated by AR(1) or ARMA, but you still believe the correlation depends only on lag distance.

Unstructured

Completely unconstrained correlations and variances for each pair of time points. For m time points, there are m(m+1)/2 parameters. This is the most flexible but requires the most parameters.

When appropriate: Only with few time points and large sample sizes. With many time points, the number of parameters becomes impractical.

AR(1) Correlation Structure
Corr(Yj, Yk) = ρ|j−k|   —   e.g., lag 1: ρ, lag 2: ρ², lag 3: ρ³
StructureParametersKey FeatureAssumption
Compound Symmetry1Equal correlationsNo autocorrelation
AR(1)1Geometric decayEquidistant time points
ARMA(1,1)2Flexible decayEquidistant time points
Toeplitzm − 1Lag-specific correlationsEquidistant time points
Unstructuredm(m+1)/2Completely flexibleNone

Combining Random Effects with Correlation Structures

An important practical consideration is how random effects interact with error correlation structures. Some combinations are redundant and cannot be separately identified:

  • Random intercepts + compound symmetry errors = redundant — both produce the same correlation structure
  • Random intercepts + AR(1) errors = useful — produces a structure where correlations decay but do not reach zero
  • Unstructured errors + random effects = pointless — the unstructured covariance already captures everything

Covariance pattern models use no random effects at all, relying entirely on the structured covariance of the errors to capture within-subject correlation.

Model Selection

For nested correlation structures (e.g., AR(1) is nested within Toeplitz), use likelihood ratio tests. For non-nested structures (e.g., AR(1) vs. compound symmetry), use AIC or similar information criteria. Models should be compared with the same fixed effects and random effects structure.

Example: Comparing Correlation Structures

In a study with 6 equally-spaced measurements, the empirical correlations ranged from 0.72 (lag 1) to 0.31 (lag 5). An AR(1) model with ρ = 0.73 fit well (AIC = 2,341), while compound symmetry (AIC = 2,398) fit poorly because it predicted equal correlations of 0.52 at all lags. The Toeplitz model (AIC = 2,338) offered a slight improvement over AR(1) but used 4 more parameters. Based on parsimony, AR(1) was selected.

Section 3 Knowledge Check

1. The AR(1) correlation structure assumes:

In AR(1), the correlation between measurements k time steps apart is ρk, producing an exponential decay in correlation with increasing time distance. This captures the intuitive autocorrelation pattern in longitudinal data.

2. Combining random intercepts with compound symmetry errors:

A random intercept model induces compound symmetry correlations, and adding a separate compound symmetry error structure produces the same overall structure. Only one is needed; they cannot be separately identified.

3. For choosing between non-nested correlation structures (e.g., AR(1) vs. Toeplitz), one should use:

Non-nested models cannot be compared with likelihood ratio tests. AIC (or similar information criteria) can be used to compare models with the same number of random effects but different correlation structures.

Reflection

A study measures blood pressure at 6 monthly visits. The correlation between visits 1 and 2 is 0.60, between visits 1 and 6 is 0.15. Which correlation structure would you initially consider, and why?

Reflection saved!
* Complete the quiz and reflection to continue.
Section 4

Trend Models, Discrete Outcomes & GEE

⏱ Estimated time: 20 minutes

Trend Models with Random Slopes

An alternative to modelling the error correlation directly is to include random slopes for time. This allows each subject to have their own rate of change (growth or decline) over time, with the population-average trend captured by the fixed effect of time.

The variation in individual trajectories naturally induces autocorrelation—subjects who start high and decline slowly will have correlated measurements. This can be sufficient to capture the temporal structure in many datasets, especially when the primary interest is in individual trajectories.

The time variable can be parameterized in different ways: linear (for constant rates of change), polynomial (for curved trajectories), or log-transformed (for rapid early change that levels off).

Discrete Repeated Measures Data

Extending mixed models to discrete outcomes (binary, count) with correlation structures is much harder than for continuous outcomes. The fundamental challenge is that in GLMs, the error term and the linear predictor operate on different scales—the link function transforms the relationship, making it difficult to add correlation structures to the error term in a meaningful way.

When to Use GEE vs. Mixed Models

Use GEE when your research question focuses on population-averaged (marginal) effects—for example, “What is the average treatment effect across the population?” Use mixed models when you want subject-specific (conditional) effects or when the random effects themselves are of scientific interest—for example, “How much do individual subjects vary in their response?”

Transition Models

One approach for discrete repeated measures is the transition model, which includes the previous outcome as a predictor. This captures autocorrelation informally through dependence on the prior outcome.

Transition Model (Eq 23.5)
logit(pij) = Xβ + Zu + γYi,j−1

Here, γ is the log odds ratio comparing those with versus without the previous event. A positive γ means that having the event at the previous time point increases the odds of having it at the current time point.

Generalised Estimating Equations (GEE)

GEE is a population-averaged (marginal) approach that does not require specifying random effects. Instead, it specifies a “working” correlation structure and uses robust (sandwich) standard errors that provide valid inference even if the working correlation is misspecified.

Trend Models

Trend models add random slopes for time, allowing each subject to have their own trajectory. The random slope induces autocorrelation through the variation in individual trajectories. This approach is particularly natural when the scientific question is about individual growth or decline rates.

Key considerations: Choice of time parameterization (linear, polynomial, log), whether to include both random intercepts and slopes, and whether the induced autocorrelation is sufficient or additional error correlation is needed.

Transition Models

Transition models include the previous outcome Yi,j−1 as a predictor in the model. The coefficient γ represents the log OR for the event given the previous event occurred. This approach is intuitive and can be combined with random effects.

Limitations: Difficult to interpret coefficients for other predictors (they are conditional on the previous outcome), requires careful handling of the first observation (which has no “previous” value), and may not fully capture complex autocorrelation patterns.

Generalised Estimating Equations (GEE)

GEE estimates population-averaged effects using a quasi-likelihood approach. Key features:

  • Specifies a working correlation (e.g., exchangeable, AR(1), unstructured)
  • With robust (sandwich) SEs, inference is valid even if the working correlation is wrong
  • Requires enough clusters/subjects (≥20–30) for reliable sandwich SEs
  • Cannot estimate cluster-specific (random) effects—gives only PA estimates
  • Better working correlation = more efficient estimates (but always valid with robust SEs)
👥
Population-Averaged
Click to learn more
👤
Subject-Specific
Click to learn more
🔐
Robust (Sandwich) SEs
Click to learn more
Example: GEE Analysis of Repeated Binary Outcome

A study followed 200 patients over 4 visits, recording whether they experienced a symptom (yes/no) at each visit along with a treatment indicator. A GEE model with exchangeable working correlation and robust SEs estimated the treatment OR as 0.65 (95% CI: 0.48–0.88), suggesting treatment reduced the odds of symptoms by 35% on average across the population. The working correlation was estimated as 0.42.

FeatureGEEMixed Models (GLMM)
Estimate typePopulation-averaged (PA)Subject-specific (SS)
Random effectsNot estimatedEstimated
CorrelationWorking correlation + robust SEsExplicit random effects / correlation
Missing data assumptionMCARMAR
Minimum clusters≥20–30Fewer acceptable
Best forPA inferenceSS inference, variance components

Section 4 Knowledge Check

1. Trend models with random slopes for time:

Random slopes for time allow each subject’s outcome to change at their own rate, with the population-average trend captured by the fixed effect of time and individual deviations captured by the random slope.

2. In a transition model, the previous outcome Yi,j−1 is included to:

Transition models include the prior outcome as a predictor, which implicitly captures autocorrelation. The coefficient γ represents the log OR for the event given that the previous outcome was 1 vs. 0.

3. GEE (Generalised Estimating Equations) provide:

GEE is a marginal/PA approach that estimates population-level effects. With sandwich (robust) SEs, inference is valid even if the working correlation structure is misspecified, though efficiency improves with a better working correlation.

Reflection

Compare the GEE approach and the mixed model approach for analyzing repeated binary outcomes. In what research context would you prefer each approach, and why?

Reflection saved!
* Complete the quiz and reflection to continue.
Final Assessment

Lesson 11 — Comprehensive Assessment

⏱ Estimated time: 25 minutes

This final assessment covers all material from this lesson. You must answer all 15 questions correctly (100%) and complete the final reflection to finish the lesson.

Final Reflection

Reflecting on this entire lesson, how would you approach the analysis of a longitudinal study with 6 time points, some missing data, and a binary outcome? Walk through your analytical strategy from descriptive analysis to final model choice.

Reflection saved!

Final Assessment (15 Questions)

1. Repeated measures data differs from standard clustered data primarily because:

While repeated measures are clustered within subjects, the key distinguishing feature is that the temporal ordering of measurements creates autocorrelation — correlation that depends on the time distance between observations.

2. A balanced, uniform, equidistant repeated measures design:

This is the most regular data structure: same number of measurements (balanced), same time points across subjects (uniform), and equal spacing between time points (equidistant).

3. Profile plots in repeated measures analysis show:

Profile plots display each subject’s series of measurements over time, allowing visual assessment of tracking (whether subjects maintain their relative positions), variability, and overall trends.

4. The Bonferroni correction for separate time point analyses:

When performing separate analyses at each time point, the Bonferroni correction divides α by the number of tests, reducing the chance of false positives. However, this approach is conservative and wasteful of information.

5. The summary statistic approach to repeated measures analysis:

By summarizing each subject’s time series into one statistic (slope, AUC, drop, etc.), the method avoids modeling within-subject correlations. It’s simple and robust but loses information about the temporal pattern.

6. Compound symmetry assumes:

Compound symmetry (exchangeable correlation) assumes that the correlation between any two measurements on the same subject is the same, regardless of how far apart in time they are.

7. The AR(1) correlation structure models correlations as:

In AR(1), corr(Yj, Yk) = ρ|j−k|. This produces correlations that decrease geometrically as the time gap between measurements increases, capturing the typical autocorrelation pattern.

8. The unstructured covariance matrix:

The unstructured covariance has m(m+1)/2 parameters for m time points, allowing completely flexible variances and covariances. Its drawback is the large number of parameters needed with many time points.

9. Random intercepts combined with AR(1) errors:

Combining random intercepts with AR(1) errors produces a correlation structure where the base correlation (from the random intercept) doesn’t decay to zero, while the AR(1) part adds additional correlation that does decay — more flexible than either alone.

10. Trend models with random slopes for time:

Random slopes for time let each subject have their own rate of change, and this variation in trajectories naturally induces autocorrelation. Combined with random intercepts, they form a flexible model for longitudinal data.

11. The main challenge of extending mixed models to discrete repeated measures data is:

In GLMs, the mean and variance are on different scales (observation vs. link scale). This makes incorporating correlation structures into the error term fundamentally more complex than for linear mixed models.

12. In a transition model, the parameter γ for the lagged outcome Yi,j−1 represents:

In the transition model logit(pij) = Xβ + Zu + γYi,j−1, γ is the log OR for the current event given the prior event occurred vs. did not occur, capturing the temporal dependence informally.

13. GEE uses a “working” correlation structure because:

GEE specifies a working correlation for efficiency, but the sandwich (robust) standard errors ensure valid inference regardless of whether the working correlation matches the true one. Better specification improves efficiency.

14. GEE estimates are:

GEE provides population-averaged (marginal) estimates, which represent the average effect across the entire population. This contrasts with mixed models, which give subject-specific (conditional) estimates.

15. When choosing between GEE and mixed models for repeated measures:

The choice depends on the research question: GEE for population-level (PA) effects, mixed models when cluster-specific (SS) effects or variance components are of interest. Both have valid but different interpretations.

Lesson 11 Complete!

Congratulations! You have successfully completed the Repeated Measures Data module. Your responses have been downloaded automatically.