Tutorials › Pattern-Mixture and Selection Models › Encoding Monotone Dropout Patterns

Pattern-Mixture Models for Dropout · Tutorial 195 of 499

Encoding Monotone Dropout Patterns

Learn to translate longitudinal observation histories into last-observed-visit pattern labels, while keeping different schedules and intermittent missingness distinct.

Advanced 10 min read

What You'll Learn

  • Define a monotone observation sequence and its last-observed-visit pattern.
  • Convert visit-by-visit indicators into a single pattern label and one-hot indicators.
  • Encode and summarize patterns in a hypothetical longitudinal data set.
  • Handle different visit schedules without treating unscheduled visits as missing.
  • Diagnose when a last-visit code would misrepresent the observed history.
  • Distinguish pattern encoding from assumptions about missing outcomes or dropout mechanisms.

Why Encode Dropout Patterns?

In a longitudinal study, each participant may contribute outcomes at several scheduled visits, then stop providing measurements. When dropout is monotone, the observed history has a simple structure: visits are observed up to some point, and all later scheduled visits are unobserved. Encoding that history by its last observed visit replaces a string of visit-level indicators with one pattern label. This is useful bookkeeping for pattern-mixture analyses, but the label must accurately represent the schedule and observation history.

The goal here is to define and encode the patterns, not to specify outcome distributions within them. A pattern label describes which scheduled outcomes were observed. By itself, it does not explain why observations ended, determine the values of missing outcomes, or establish whether missingness is ignorable.

Definition for a Common Visit Schedule

Suppose participant \(i\) has a baseline measurement and \(J\) planned post-baseline visits, ordered in time as visits \(1,\ldots,J\). Assume baseline is observed for the participants being coded. Let \(R_{ij}=1\) if participant \(i\)'s outcome is observed at post-baseline visit \(j\), and \(R_{ij}=0\) if it is not observed. The index \(j\) refers to the scheduled visit, not necessarily to equally spaced time.

Definition: The observation history is monotone if, for each participant, an unobserved scheduled visit is never followed by a later observed scheduled visit. With \(R_{ij}\) coded as 1 for observed and 0 for unobserved, this means \(R_{i1}\ge R_{i2}\ge\cdots\ge R_{iJ}\). The last-observed-visit pattern is \(D_i=\max\{j:R_{ij}=1\}\), with \(D_i=0\) if no post-baseline visit is observed. Thus \(D_i\) takes one of the values \(0,1,\ldots,J\).

Under this definition, \(D_i=J\) means all \(J\) post-baseline visits were observed; it does not mean that the participant dropped out after visit \(J\). For \(D_i<J\), the participant's scheduled visits after \(D_i\) are unobserved. A study that observes everyone at baseline can keep baseline outside this code, so \(D_i=0\) means “baseline observed, no post-baseline visit observed.” If baseline itself may be missing, that status must be recorded separately rather than silently folded into this definition.

A categorical code can also be represented by indicators. For each \(k=0,\ldots,J\), define \(Z_{ik}=1\) when participant \(i\) has pattern \(k\), and \(Z_{ik}=0\) otherwise. Exactly one such indicator is 1 for each participant. This representation is convenient when tabulating patterns; it does not change what the pattern means.

$$ Z_{ik}=I(D_i=k), \qquad \sum_{k=0}^{J}Z_{ik}=1, \qquad R_{ij}=I(j\le D_i). $$

Worked Encodings

Worked Example: Turning Visit Indicators Into a Pattern

Consider a hypothetical study with four planned post-baseline visits. One participant's indicators are \((R_{i1},R_{i2},R_{i3},R_{i4})=(1,1,0,0)\). Assume the visits are ordered as planned and the indicators refer to whether the outcome was actually observed at each scheduled visit.

The sequence is monotone: once a zero appears at visit 3, there are no later ones. The last visit with an observed outcome is visit 2, so \(D_i=2\). The pattern indicators are \(Z_{i0}=0,\;Z_{i1}=0,\;Z_{i2}=1,\;Z_{i3}=0,\;Z_{i4}=0\). The code \(D_i=2\) reconstructs the observed history because \(R_{ij}=I(j\le2)\), giving \((1,1,0,0)\).

If instead the history were \((1,1,1,1)\), its code would be \(D_i=4\), the all-post-baseline-visits-observed pattern. If the history were \((0,0,0,0)\), its code would be \(D_i=0\), under the stated convention that baseline is handled separately.

Worked Example: Counting Patterns in a Hypothetical Trial

Eight hypothetical participants have four post-baseline visits on the same schedule. After checking their records, their pattern codes are \(D_i=(4,2,3,2,4,1,3,2)\). These codes are consistent with monotone histories; for example, each participant coded 2 has visits 1 and 2 observed and visits 3 and 4 unobserved.

Count the codes \(0,1,2,3,4\), in that order. The counts are \(n_0=0,\;n_1=1,\;n_2=3,\;n_3=2,\;n_4=2\). They sum to the sample size: \(0+1+3+2+2=8\). The corresponding sample proportions are each count divided by 8: \(0/8=0\), \(1/8=0.125\), \(3/8=0.375\), \(2/8=0.250\), and \(2/8=0.250\). These are descriptive proportions of participants assigned to each observed pattern in this hypothetical sample.

For instance, the proportion in pattern 2 is \(3/8=0.375\), or 37.5%. It describes the observed sample's pattern frequencies; it is not a probability that a missing outcome takes a particular value, nor does it describe the reason for dropout.

Worked Example: Different Planned Visit Schedules

Suppose a hypothetical study includes two protocol schedules. Schedule A plans post-baseline visits at weeks 4, 8, 12, and 16. Schedule B plans visits at weeks 6, 12, and 18. A participant on schedule A is observed at weeks 4 and 8 but not at weeks 12 and 16. A participant on schedule B is observed at weeks 6 and 12 but not at week 18.

For the schedule A participant, there are four scheduled post-baseline visits, and the last observed scheduled visit has ordinal index 2. Record the pattern as schedule A, \(D_i=2\); the last observed time is week 8. For the schedule B participant, there are three scheduled post-baseline visits, and the last observed scheduled visit also has ordinal index 2. Record schedule B, \(D_i=2\); the last observed time is week 12.

The two participants share an ordinal index but not a last-observed calendar time. Therefore, reporting only \(D_i=2\) would discard schedule information if the actual time matters. A safe encoding retains the schedule identifier alongside the within-schedule pattern, such as \((\text{A},2)\) and \((\text{B},2)\). The week-12 visit on schedule A is scheduled; week 12 is not a scheduled visit on schedule B. It would be incorrect to code that absence as a missed visit for the schedule B participant.

Why the Single Code Works

The equivalence between a monotone history and its last-observed-visit code is exact. If a history is monotone and \(D_i=k\), then all visits through \(k\) must be observed: otherwise, a zero before \(k\) would be followed by the one at \(k\), contradicting monotonicity. All visits after \(k\) must be unobserved by the definition of \(k\). Hence \(R_{ij}=1\) for \(j\le k\) and \(R_{ij}=0\) for \(j>k\). Conversely, the sequence defined by \(R_{ij}=I(j\le k)\) is monotone and has last observed visit \(k\). So there is a one-to-one correspondence between the \(J+1\) possible last-visit codes and the monotone histories on a common schedule.

$$ D_i=k \quad\Longleftrightarrow\quad (R_{i1},\ldots,R_{iJ})=(\underbrace{1,\ldots,1}_{k\text{ visits}},\underbrace{0,\ldots,0}_{J-k\text{ visits}}). $$

The end cases follow the same rule: \(k=0\) gives all zeros, and \(k=J\) gives all ones. This one-to-one result is why a single code is sufficient for monotone histories. It also shows what is lost if the history is not monotone: the last observed visit alone cannot tell which earlier scheduled visits were missed.

Schedules, Diagnostics, and Failure Modes

Before assigning codes, define the scheduled opportunities for measurement. A visit that was never planned for a participant is not an unobserved outcome at a scheduled visit. For a common schedule, an observation-indicator row should have the form a sequence of ones followed by zeros. For different schedules, first identify which visits were planned for each participant. One option is to code patterns within schedule and retain the schedule label; another is to use a shared time grid only if the meaning of every grid point is defined consistently.

Useful checks include:

  • Inspect each participant's ordered observation indicators for a zero followed by a one. Such a sequence is not monotone under the stated definition.
  • Verify visit dates against the protocol schedule before deciding that a visit was missed. A late measurement may still count as the observation for its scheduled visit if that is the study's prespecified rule.
  • Check that the last-observed visit and the pattern code agree, and that pattern counts sum to the number of participants coded.
  • Keep distinctions such as withdrawal, missed appointment, administrative study end, and death when they matter. A last-visit code alone does not preserve those reasons.

A participant observed at visits 1 and 3 but not visit 2 has a nonmonotone history \((1,0,1)\). Coding this participant as \(D_i=3\) would wrongly imply that visit 2 was observed; coding as \(D_i=1\) would wrongly imply that visit 3 was not observed. Do not force such records into a monotone pattern. First determine whether the record reflects an error, a visit-schedule issue, or genuine intermittent missingness. If genuine, a richer representation that retains visit-level indicators is needed.

Pattern coding is therefore more compact than a full indicator history only when monotonicity and schedule definitions support that reduction. Visit-level indicators remain the direct alternative when intermittent missingness is possible or when the analysis needs to distinguish individual missing visits. Coding by stated reason for dropout answers a different question: it may be useful, but reasons do not necessarily determine the observed history, and several reasons can lead to the same last-visit pattern.

What the Code Does—and Does Not—Assume

The coding rule assumes a defined ordering of scheduled visits and an observation history that is monotone within that schedule. It does not assume that dropout is independent of observed outcomes, nor does it establish a missing-at-random or missing-not-at-random mechanism. Participants with the same code may differ in their outcomes, baseline characteristics, treatment assignments, or reasons for leaving. Pattern-specific outcome distributions and the way patterns contribute to a population mixture are separate modeling questions.

A common mistake is to read “last observed visit” as an explanation of missingness: “Everyone in pattern 2 dropped out because of poor response, so later outcomes must be worse.” That conclusion does not follow from the code. The correction is to treat the code only as a summary of observed-versus-unobserved scheduled outcomes. Any explanation of dropout, or claim about outcomes after dropout, requires additional information and modeling assumptions.

Key takeaway: On a defined common schedule, a monotone observation history is encoded exactly by \(D_i\), the index of its last observed scheduled visit, with \(D_i=0\) for no observed post-baseline visits. Retain schedule information when visit calendars differ, and use a richer history for intermittent missingness.

Check Your Understanding

Answer each question using the stated visit order and coding convention.

  1. For five post-baseline visits, what is \(D_i\) for the history \((1,1,1,0,0)\), and what is the corresponding pattern-indicator vector \((Z_{i0},\ldots,Z_{i5})\)?
  2. Can the history \((1,0,1,0)\) be represented without loss by a last-observed-visit code? Explain.
  3. A schedule has three post-baseline visits. What history corresponds to \(D_i=0\), and what history corresponds to \(D_i=3\)?
  4. Two schedule groups have different visit calendars, but a participant in each group has ordinal pattern code 2. What information should be retained before comparing their patterns?

Solutions. 1. The last observed visit is 3, so \(D_i=3\) and \((Z_{i0},\ldots,Z_{i5})=(0,0,0,1,0,0)\). 2. No. The zero at visit 2 is followed by an observed visit 3, so the history is nonmonotone and the last visit alone cannot encode which visits were observed. 3. \(D_i=0\) corresponds to \((0,0,0)\); \(D_i=3\) corresponds to \((1,1,1)\). 4. Retain each participant's schedule identifier and, where relevant, the actual last-observed scheduled time. The same ordinal index need not refer to the same calendar time.

Clinical Biostats