Tutorials › Pattern-Mixture and Selection Models › Defining Variables for Repeated-Measures Trials

The Estimand Framework and Intercurrent Events · Tutorial 392 of 499

Defining Variables for Repeated-Measures Trials

Learn how to turn a visit schedule and its endpoint rules into clear, reproducible participant-level outcome variables.

Intermediate 10 min read

What You'll Learn

  • Distinguish a scheduled target visit from an observed assessment date.
  • Specify endpoint windows and rules for assigning measurements to visits.
  • Construct participant-level repeated-measures vectors and baseline changes.
  • Define when an endpoint is a selected measurement or a summary across a window.
  • Diagnose ambiguous windows, missing measurements, and inconsistent visit assignments.
  • Compare longitudinal outcome definitions without confusing them with population-level treatment contrasts.

Why Visit Definitions Are Part of the Outcome

A repeated-measures trial records an outcome for the same participant at several times. But “the outcome at week 12” is not yet a fully defined variable. A protocol needs to say what date counts as week 12, whether a nearby assessment can stand in for the target date, and what to do if more than one assessment falls nearby. Those choices determine which clinical measurement enters the analysis.

The goal here is to define the participant-level variables that represent a clinical course. This is not the same as choosing a population summary or treatment contrast. Those summaries require clearly defined participant-level outcomes as their starting point.

Definition: Let \(i\) index participants and let \(t_1,\ldots,t_K\) denote prespecified target times, such as weeks 4, 8, and 12. A repeated-measures outcome for participant \(i\) is the ordered collection of outcome values defined at those times, \( (Y_i(t_1),\ldots,Y_i(t_K)) \). To make this collection operational, the study must specify how each target time is linked to an actual assessment, what measurement is used if there are several, and how an unavailable measurement is represented.

A target time is part of the scientific definition; an assessment date is what happened in practice. They need not be identical. For example, a target of day 56 might permit assessments from day 53 through day 59. A rule such as “use the assessment closest to day 56” translates that schedule into a reproducible variable. It does not make the assessment occur on day 56; it defines which observed value represents the target visit.

Specify the Schedule and the Assignment Rule

A useful definition begins with a table of target times and permitted windows. The window endpoints should be explicit, including whether they are inclusive. Then state how to choose among eligible assessments. Common rules include selecting the closest assessment to the target, selecting the earliest or latest eligible assessment, or summarizing all eligible assessments. These rules create different variables and should not be treated as interchangeable.

Definition elementQuestion to answerExample specification
Target timeWhen is the outcome intended to describe the participant?Day 56
Endpoint windowWhich actual assessment dates are eligible?Days 53 through 59, inclusive
Selection or summary ruleWhat if no assessment is exactly on the target, or several are eligible?Use the eligible assessment closest to day 56
Tie ruleWhat if two eligible assessments are equally close?Use the earlier assessment
Unavailable valueWhat is recorded if there is no eligible assessment?Mark the target-visit outcome as unavailable; do not substitute a value implicitly

Windows should be designed so that an assessment is not inadvertently assigned to two target visits. If windows overlap, the assignment rule must say whether an assessment can contribute to both visits or must be assigned to only one. In the latter case, specify how to decide between targets. A vague instruction such as “use the nearest visit” can leave the same assessment eligible for multiple targets.

Definition: An endpoint window is a prespecified range of actual assessment times associated with a target time. An assignment rule maps eligible observed assessments to the target-visit variable, or combines eligible assessments according to a stated summary rule. The window and rule together define which data value represents that target visit.

Worked Example: Selecting the Measurement Closest to a Target Visit

Suppose a hypothetical trial defines the day-56 outcome using assessments from days 53 through 59, inclusive. A participant has a score of 11 on day 52, a score of 8 on day 53, and a score of 6 on day 58. The rule is to use the eligible assessment closest to day 56.

Day 52 is outside the window, so its score of 11 is not eligible. Compare the dates of the recorded assessments that are inside the window: day 53 is \(|53-56|=3\) days from the target, and day 58 is \(|58-56|=2\) days from the target. Day 58 is closer.

$$ Y_i(56)=6 $$

Thus the defined day-56 outcome for this participant is 6. The selection is determined by the dates, not by which score looks more plausible or more favorable. If the eligible assessments had been equally far from day 56, the prespecified tie rule would decide which one to use.

Representing a Course With Several Visits

When each target visit has a defined value, the participant’s repeated-measures outcome can be represented as an ordered vector. Keeping the visit order matters: the values describe a sequence, not an unordered collection. For instance, the same three scores in a different order would describe a different course.

A common construction is to record the outcome on its original scale at every target time. Another is to define a change from baseline at each follow-up. If \(B_i\) is participant \(i\)’s baseline value and \(Y_i(t_j)\) is the defined value at follow-up time \(t_j\), then change can be defined as \(Y_i(t_j)-B_i\). If lower scores indicate better health, negative change indicates improvement under this convention. A study could instead define improvement as \(B_i-Y_i(t_j)\); then positive values indicate improvement. State the direction explicitly.

Worked Example: Building a Participant-Level Outcome Vector

In a hypothetical trial, lower symptom scores indicate fewer symptoms. The target visits are baseline, week 4, week 8, and week 12. Each follow-up value is the assessment selected by the trial’s stated visit rule. For one participant, the defined scores are 30 at baseline, 24 at week 4, 21 at week 8, and 19 at week 12.

The original-scale repeated-measures outcome is:

$$ (30,\ 24,\ 21,\ 19) $$

Define change from baseline as follow-up score minus baseline score. The calculations are \(24-30=-6\) at week 4, \(21-30=-9\) at week 8, and \(19-30=-11\) at week 12. The change vector, including the baseline change of zero, is:

$$ (0,\ -6,\ -9,\ -11) $$

Because lower symptom scores indicate fewer symptoms, the negative changes represent reductions in symptoms. The vector displays the participant’s measurements across the specified visits; it does not by itself describe an average response in a population.

A visit rule also needs to say what happens when no assessment is available within a window. The outcome at that target is unavailable under the stated measurement schedule. It is not automatically zero, the previous visit’s value, or a value inferred from a later visit. Defining the variable and addressing unavailable data are related but distinct tasks: the first specifies what value would count at a target, while a separate analysis must explain how unavailable values are handled.

Summaries Within an Endpoint Window

Sometimes the scientific question calls for a summary over a period rather than one selected assessment. For example, the endpoint might be the average score across a final two-week window. In that case, define the window and the summary precisely. If the rule is an arithmetic mean of all eligible observed scores, the participant-level value is the sum of those scores divided by the number of eligible scores. The definition should also state what happens when there are no eligible assessments.

Worked Example: Defining an Average Over a Final Window

A hypothetical trial defines its final-window symptom outcome as the arithmetic mean of observed scores from days 77 through 91, inclusive. Three eligible assessments for one participant are 24 on day 78, 20 on day 84, and 22 on day 91.

Under the stated rule, the participant-level final-window value is:

$$ \frac{24+20+22}{3}=\frac{66}{3}=22 $$

The defined outcome is 22 symptom-score points. The average uses all three eligible assessments; it is not the score at the midpoint day, nor the closest score to the midpoint. If the trial instead wanted a single assessment near a target day, it would need to define that selection rule instead. If a participant had no assessment in the window, this arithmetic mean would not be defined from observed assessments, so the protocol would need to specify how that case is represented and handled.

A mean across observed visits can also depend on how many assessments a participant contributes and when those assessments occur. It may therefore describe a different feature of the clinical course from a single target-time measurement. Defining the intended feature first helps prevent a convenient data summary from silently replacing the clinical question.

Why the Nearest-Visit Rule Works as a Definition

The nearest-visit rule is an operational convention, not a claim that the selected measurement is identical to the unobserved value at the exact target time. It has a simple justification: among eligible assessment dates, it minimizes the distance between the recorded date and the target date.

To see this, let \(t\) be the target time and let \(s\) be an eligible assessment date. The rule selects the eligible \(s\) that minimizes \(|s-t|\). For the day-56 example, the eligible dates are 53 and 58, so their distances are 3 and 2 days. Since \(2<3\), day 58 is selected. If distances tie, the minimization alone does not pick a unique date; a separate tie rule is necessary. This justification explains the rule’s timing property, but does not establish that clinical scores cannot change between assessment dates.

$$ s^* \in \operatorname*{arg\,min}_{s\in W}|s-t| $$

The window restriction is essential: without it, a very distant assessment could be selected merely because it is the closest available. A maximum distance from the target can also be imposed. If no assessment is both eligible and within that distance, the target value remains unavailable under that rule.

Diagnostics, Alternatives, and Common Pitfalls

Before using a constructed repeated-measures variable, check that the rule can be applied consistently to every participant. Useful diagnostics include listing the actual assessment dates assigned to each target, counting how often each target has zero, one, or multiple eligible observations, and checking whether any assessment was assigned to more than one target. Review dates near boundaries particularly carefully, because a single-day misunderstanding can change eligibility.

The main alternatives differ in what they say about the clinical course:

  • Fixed target with nearest eligible assessment: retains one measurement per target and limits timing deviations through a window. It does not remove all differences in actual assessment time.
  • One selected assessment by another rule: choosing the earliest or latest eligible measurement may be appropriate for a stated purpose, but it represents a different point within the window and needs a clear rationale.
  • Summary across a window: an average or other summary uses multiple assessments and represents the window as a whole, rather than a single target time. Its definition must address the number and timing of observations.
  • Longitudinal vector: retains defined values at multiple targets and represents a sequence of measurements. Reducing it to one endpoint can discard information about how the course unfolded.

These constructions are not automatically interchangeable. A target-time score, a window average, and a sequence of scores describe different outcome variables, even if they use measurements from the same participants. The appropriate definition follows the clinical question and must be fixed before the values are selected.

  • Mistake: treating the window boundary as an observed date. If the window starts on day 53, that does not mean an assessment occurred on day 53. Compare only recorded eligible dates when applying a nearest-date rule.
  • Mistake: choosing a value based on its numerical result. Selecting the most favorable or most complete score after viewing the data makes the assignment depend on the outcome. Apply the prespecified rule using dates and eligibility.
  • Mistake: treating no eligible assessment as a score of zero. Zero is a real outcome value only when the measurement scale and definition make it one. An unavailable assessment is not implicitly zero.
  • Mistake: assuming the same assessment can fill every nearby target. That may duplicate one measurement across visits and distort the represented course. Check window overlap and specify whether reuse is permitted.
Key takeaway: A repeated-measures outcome is defined by more than a list of nominal visit labels. Specify the target times, eligible windows, measurement-selection or summary rule, tie and overlap rules, and representation of unavailable values. Then the participant-level variables have a clear and reproducible interpretation.

Check Your Understanding

Answer each question using the stated outcome definition. Solutions follow the questions.

  1. A day-42 target has an inclusive window of days 39–45. A participant has scores of 15 on day 38, 12 on day 40, and 10 on day 44. Under the nearest-date rule, which score represents day 42?
  2. A study defines change as follow-up score minus baseline. A participant’s baseline score is 27 and week-8 score is 20. What is the week-8 change, and what does its sign mean if lower scores indicate improvement?
  3. A final-window outcome is the mean of all observed eligible scores. The eligible scores are 8, 11, and 14. Calculate the defined outcome.
  4. Why does a rule that chooses the closest eligible assessment still need a tie rule?
  5. What should be recorded under a nearest-visit rule if there is no assessment in the prespecified window?

Solutions. (1) Day 38 is outside the window. Day 40 is \(|40-42|=2\) days from the target and day 44 is \(|44-42|=2\) days away. The dates tie, so the stated tie rule is needed to choose between scores 12 and 10; without it, the definition is incomplete. (2) The change is \(20-27=-7\) score points. Since lower scores indicate improvement, the negative change represents a 7-point reduction. (3) The mean is \((8+11+14)/3=33/3=11\). (4) Two eligible dates can be equally distant from the target, so minimizing distance alone may select more than one date. A prespecified tie rule makes the assignment unique. (5) The target value is unavailable under that measurement rule. It is not automatically set to zero or replaced with another visit’s value.

Clinical Biostats