Why Unequal Sequence Counts Need Careful Analysis
In a two-period crossover, subjects are assigned to one of two sequences: TR (test followed by reference) or RT (reference followed by test). In practice, withdrawals or missing measurements can leave different numbers of complete subjects in each sequence. The data are still informative, but a simple pooled comparison can mix the treatment effect with the period effect. A mixed-effects model represents those sources of variation separately and uses each subject’s repeated measurements without treating them as independent observations.
The example below is hypothetical. Each response is a natural-log-transformed exposure measure, such as AUC, and the analysis includes only subjects with both period measurements. Log responses are dimensionless; treatment differences on this scale correspond to log ratios.
Model and Assumptions
Let \(Y_{isp}\) be the log response for subject \(i\) in sequence \(s\) during period \(p\). Use R as the reference treatment and period 1 as the reference period. A standard random-intercept model is
Here, \(\mu\) is the reference mean, \(\alpha_s\) is the fixed sequence effect, \(\pi\) is the period-2 versus period-1 effect, and \(\tau\) is the adjusted T-versus-R treatment effect on the log scale. The subject-specific random intercept \(b_{i(s)}\) accounts for stable differences between subjects in the same sequence. For identifiability, the sequence effects need a constraint, such as \(\alpha_{TR}+\alpha_{RT}=0\); an equivalent reference-cell parameterization is also valid.
The model assumes that a subject’s two responses are correlated through the shared random intercept. It also assumes that, conditional on the modeled effects, the residual variation has the same variance for both formulations and periods. Those assumptions should be checked rather than inferred from the fact that software returned estimates. The earlier material on residual diagnostics, unequal residual variances, normality, influential subjects, and treatment-by-period interaction gives relevant diagnostic tools.
Worked Dataset and Adjusted Estimate
Worked Example: Unequal TR and RT Sequence Counts
Suppose a hypothetical study has four complete TR subjects and three complete RT subjects. The entries below are log exposure measurements. For each subject, define \(z_i=Y_T-Y_R\), the subject’s T-minus-R difference, regardless of period order.
| Sequence | Subject | Period 1 | Period 2 | \(z_i=Y_T-Y_R\) |
|---|---|---|---|---|
| TR | 1 | T: 5.00 | R: 4.82 | 0.18 |
| TR | 2 | T: 5.10 | R: 4.97 | 0.13 |
| TR | 3 | T: 4.90 | R: 4.80 | 0.10 |
| TR | 4 | T: 5.20 | R: 5.08 | 0.12 |
| RT | 5 | R: 4.90 | T: 5.02 | 0.12 |
| RT | 6 | R: 5.00 | T: 5.18 | 0.18 |
| RT | 7 | R: 4.80 | T: 4.91 | 0.11 |
For a TR subject, T is measured in period 1 and R in period 2, so the expected T-minus-R contrast is \(\tau-\pi\). For an RT subject, T is in period 2, so the expected contrast is \(\tau+\pi\). Consequently, the expectations of the sequence-specific sample means are
The sample means are estimates of these expectations, not identities: sampling residuals mean they will not generally equal the underlying contrasts. For these data,
Under the common residual-variance model, both sequence-specific contrasts have the same variance for an individual subject, \(2\sigma^2\). The two sequence means therefore estimate their respective expected contrasts, with their precision reflecting their different sample sizes. Solving the two contrast equations for treatment and period gives the estimates
Thus, the adjusted estimated T-versus-R difference is 0.1346 log units. The estimated period-2 effect is 0.002083 log units. This contrast-based calculation agrees with the fixed-effect treatment estimate from the stated mixed model for complete two-period subjects under its common residual-variance structure. The random intercept cancels from each within-subject contrast; the period term does not, which is why both sequences are needed to separate treatment and period effects.
Why the Contrast Calculation Works
For a TR subject, subtract the period-2 R response from the period-1 T response. The fixed sequence effect and the subject random intercept occur in both measurements and cancel. The remaining expected difference is treatment minus period:
For an RT subject, subtract the period-1 R response from the period-2 T response. In this order, treatment and period effects both contribute positively:
Adding these two expected contrasts eliminates \(\pi\), while subtracting them eliminates \(\tau\). Replacing the expectations by their sample estimates yields the estimators shown above. This derivation also explains why the treatment estimate is not simply the average of every subject’s difference when sequence counts are unequal: the two sequence means represent contrasts with opposite period contributions.
Interpreting the Estimate and Its Uncertainty
Worked Example: Confidence Interval and Ratio Interpretation
The within-subject contrast residuals are the observed \(z_i\) values minus their fitted sequence means. For TR, they are \(0.0475,-0.0025,-0.0325,-0.0125\); for RT, they are \(-0.01667,0.04333,-0.02667\). Their residual sum of squares is
There are seven contrasts and two fitted sequence means, so the residual degrees of freedom are \(df=7-2=5\). The estimated contrast variance is \(s_z^2=0.006342/5=0.001268\). Since the treatment estimate is half the sum of two independent sequence means, its standard error is
Using \(t_{0.975,5}\approx2.571\), a 95% interval is
Exponentiating the estimate and interval gives a geometric mean ratio estimate of \(e^{0.1346}=1.144\), with interval \((e^{0.0996},e^{0.1695})=(1.105,1.185)\). In this hypothetical dataset, the estimated geometric mean exposure under T is about 14.4% higher than under R; the interval corresponds to ratios from about 1.105 to 1.185. This interval describes uncertainty under the model and is not a statement that the fixed parameter has a 95% probability of lying in this particular interval. It also does not, by itself, establish bioequivalence; that requires a prespecified equivalence assessment.
The calculation above uses the contrast representation of this particular complete two-period design. Mixed-model software can report different denominator degrees of freedom or standard errors depending on its estimation and small-sample inference method. When reproducing an analysis, identify the fitted model, covariance structure, estimation method, and degrees-of-freedom method rather than assuming every software package must print identical inferential quantities.
Residual Diagnostics and Failure Modes
Worked Example: Inspecting the Within-Subject Contrasts
The fitted sequence contrast means are 0.1325 for TR and 0.1367 for RT. The largest absolute contrast residual is 0.0475 log units. The estimated contrast residual standard deviation is
This largest residual is not strikingly large relative to the estimated contrast standard deviation in this small example. That observation is descriptive, not proof of a normal error distribution or absence of influential subjects. With only seven subjects, a residual plot or normal quantile plot has little power to reveal modest departures from assumptions.
For a full mixed-model check, inspect conditional residuals against fitted values and period, and examine subject-level random-effect estimates. Look for changing residual spread, curvature, an isolated subject with a large residual, or systematic residual patterns by treatment or period. Interpret random-effect estimates cautiously: they are shrunken estimates and are not the same as observed residuals. The sequence-contrast residuals are useful for checking the within-subject treatment-period structure, but they do not check every feature of the random-intercept model.
Unequal sequence counts are not, on their own, a model failure. More serious problems arise if a sequence has no usable subjects, if missingness is related to unobserved outcomes in a way the analysis does not address, or if the common variance and treatment-effect assumptions are implausible. A small dataset may conceal these problems. Diagnostics should prompt scientific review and sensitivity analysis; they do not justify automatic deletion of observations or subjects.
Comparison With a Pooled Paired Difference
A paired analysis that averages all T-minus-R differences without adjusting for sequence gives
This weighted average assigns more weight to the TR sequence because it has more subjects. Since the TR and RT contrasts include \(-\pi\) and \(+\pi\), respectively, its expectation is
Here \(n_{TR}=4\), \(n_{RT}=3\), and \(\hat{\pi}=0.002083\), so the corresponding period-imbalance term is \((-1/7)(0.002083)\approx-0.000298\). The pooled value happens to be close to the adjusted estimate in this example because the estimated period effect is small. In another dataset, a larger period effect or more severe imbalance could produce a more consequential difference. The paired analysis is not inherently wrong as a description of the pooled differences; it simply does not provide the same period-adjusted treatment estimate.
A balanced crossover ANOVA and the mixed-effects approach can agree on treatment estimation under their shared assumptions when the design and handling of missing data permit it. The mixed model is particularly useful for expressing the covariance structure and accommodating unequal counts. Neither approach repairs a misspecified model, and a complete-case analysis can be biased if the pattern of missing measurements is informative.
Common Mistakes and Practical Limits
- Equating sample contrasts with population contrasts. The observed sequence mean is an estimate: \(E[\bar z_{TR}]=\tau-\pi\), not \(\bar z_{TR}=\tau-\pi\) in every sample.
- Pooling all paired differences without checking sequence balance. With unequal sequence counts, the pooled mean can retain a period-effect contribution.
- Assuming an unequal sequence count automatically invalidates the model. Unequal counts chiefly affect precision here; they do not by themselves invalidate the adjusted estimate.
- Reading a small residual plot as confirmation of assumptions. Diagnostics have limited ability to detect departures in a very small dataset, and contrast residuals do not assess all random-effects assumptions.
- Calling a log difference a percentage difference. The log estimate is 0.1346; exponentiating gives a ratio of 1.144, or an estimated 14.4% higher geometric mean under T.
- Interpreting an adjusted estimate as an equivalence decision. Equivalence requires comparison with prespecified margins using the appropriate inferential procedure.
The model’s limitations matter in interpretation. The stated model assumes complete paired observations for the contrast derivation, a common treatment effect across periods, no carryover term, and a specified random-intercept covariance structure. It is not a substitute for investigating missingness, unusual observations, heteroscedasticity, or treatment-by-period patterns. If diagnostics or study knowledge raise concerns, the model and the consequences of plausible alternatives should be examined explicitly.
Check Your Understanding
Answer the questions, then compare your reasoning with the solutions.
- In a TR sequence, why is the expected T-minus-R contrast \(\tau-\pi\) rather than \(\tau+\pi\)?
- If \(\bar z_{TR}=0.08\) and \(\bar z_{RT}=0.12\), calculate the treatment and period estimates.
- For \(n_{TR}=6\), \(n_{RT}=2\), and a nonzero period effect, why might the pooled paired mean differ from the adjusted treatment estimate?
- What does an estimated treatment effect of 0.10 log units correspond to on the ratio scale?
- Name one diagnostic feature that within-subject contrast residuals can assess and one model feature they cannot assess by themselves.
Solutions. (1) In TR, T occurs in period 1 and R in period 2, so their difference is treatment effect minus the period-2 increment: \(\tau-\pi\). (2) \(\hat{\tau}=(0.08+0.12)/2=0.10\) log units and \(\hat{\pi}=(0.12-0.08)/2=0.02\) log units. (3) The pooled mean weights the sequence contrasts by their unequal counts, so the opposite period contributions do not cancel; its expected period contribution is \((n_{RT}-n_{TR})\pi/(n_{TR}+n_{RT})\). (4) The ratio estimate is \(e^{0.10}\approx1.105\), or about 10.5% higher geometric mean under T than R. (5) Contrast residuals can reveal an unusually large subject-level within-subject difference or a pattern by sequence; by themselves they cannot establish that random intercepts follow the assumed distribution or that the full covariance model is correct.