Tutorials › Bioavailability and Bioequivalence › Why Balanced Crossover ANOVA Simplifies

Log-Scale Analysis and ANOVA · Tutorial 185 of 399

Why Balanced Crossover ANOVA Simplifies

Learn how balance creates orthogonal crossover contrasts, how to verify the result with a design matrix, and why orthogonality does not remove the need for the correct repeated-measures error term.

Intermediate 12 min read

What You'll Learn

  • Define orthogonality for the fixed-effect columns in a two-period, two-sequence crossover.
  • Verify the balanced design matrix using treatment, period, and sequence coding.
  • Derive why equal sequence counts cancel the treatment–period cross-product.
  • Calculate a treatment contrast and period contrast from hypothetical crossover data.
  • Recognize how sequence imbalance or missing observations can break orthogonality.
  • Distinguish orthogonality of design columns from independence of observations and error-term selection.

Why Balance Matters

In a two-period crossover, each subject receives both treatments, but the order differs by sequence: subjects in sequence AB receive A then B, while subjects in sequence BA receive B then A. A balanced design has the same number of subjects in each sequence, with complete measurements in both periods. This balance is more than a convenient allocation rule: it makes the treatment contrast and period contrast orthogonal in the fixed-effects design.

Orthogonality means that the corresponding design columns have zero inner product. In practical terms, under the stated model, the fitted treatment and period contrasts do not borrow information from one another through the fixed-effects design. This simplifies the algebra of estimation and the interpretation of contrasts. It does not mean the observations are independent, nor does it determine the correct ANOVA error term.

Definition: Two design columns are orthogonal when their inner product is zero: the sum of the products of corresponding entries is zero. A set of fixed-effect columns is mutually orthogonal when every pair has zero inner product. For factor contrasts, orthogonality is considered after accounting for the intercept (the grand mean).

Model and Coding

Consider the additive two-period crossover model for a log-scale pharmacokinetic endpoint:

$$ Y_{ijk}=\mu+\alpha_i+\pi_j+\tau_k+b_{s(i)}+\varepsilon_{ijk}. $$

Here \(Y_{ijk}\) is the log endpoint for sequence \(i\), period \(j\), and treatment \(k\); \(\mu\) is the grand mean; \(\alpha_i\), \(\pi_j\), and \(\tau_k\) are sequence, period, and treatment effects; \(b_{s(i)}\) is the subject effect for subject \(s\) nested within sequence; and \(\varepsilon_{ijk}\) is the residual. Use effect coding: sequence AB is \(q=+1\), sequence BA is \(q=-1\); period 1 is \(p=-1\), period 2 is \(p=+1\); treatment A is \(t=-1\), and treatment B is \(t=+1\). With this coding, the fixed-effects part is \(\mu+\beta_q q+\beta_p p+\beta_t t\). The treatment contrast B minus A is \(2\beta_t\), and the period 2 minus period 1 contrast is \(2\beta_p\).

The simple model assumes complete observations, a common treatment effect across periods, and no carryover contribution to the endpoint being analyzed. For the usual classical ANOVA inference, the random subject effects are independent across subjects with mean zero and common variance, and residuals have mean zero, common variance, and are independent across observations conditional on subject effects. Normality is used for exact small-sample F tests. The design-column orthogonality derived below is a property of the allocation and coding; it does not itself require normality. The random subject term is essential because the two observations from one person are not independent.

The Balanced Design Matrix

For one subject in each sequence, the four observation rows have the following fixed-effects design. The pattern repeats for every subject assigned to the same sequence.

SequencePeriodTreatmentInterceptSequence \(q\)Period \(p\)Treatment \(t\)
AB1A1+1-1-1
AB2B1+1+1+1
BA1B1-1-1+1
BA2A1-1+1-1

With \(n\) subjects per sequence, each of these four row patterns occurs \(n\) times. The intercept column has squared length \(4n\). Each contrast column also has squared length \(4n\), since all its entries are either \(+1\) or \(-1\). Each contrast sums to zero, so each is orthogonal to the intercept. The cross-products between the contrast columns are also zero:

$$ \sum qp=0,\qquad \sum qt=0,\qquad \sum pt=2n-2n=0. $$

For example, within either sequence the period and treatment codes multiply to \(+1\) in one period and \(-1\) in the other. The AB subjects contribute \(2n\) to \(\sum pt\), while the BA subjects contribute \(-2n\). Equal sequence counts make these contributions cancel. In matrix form, for the columns ordered as intercept, sequence, period, treatment:

$$ X^\mathsf{T}X=4nI. $$

Here \(I\) is the identity matrix. This is the simplest expression of the balanced design: the columns have equal lengths and zero cross-products. Ordinary least squares estimates for these coded fixed effects are therefore obtained by separate column projections, rather than by resolving correlations among the columns.

Worked Example: Checking Orthogonality by Hand

Suppose a hypothetical crossover has two subjects in each sequence. There are \(4n=8\) observation rows. The four-row pattern in the table occurs twice. Verify the period–treatment cross-product and the full fixed-effects cross-product matrix.

For one occurrence of the pattern, the products \(pt\), in row order, are \(+1,-1,-1,+1\). Their sum is zero. With two occurrences, \(\sum pt=2(0)=0\). The same result follows by sequence: the two AB subjects contribute \(2(2)=4\), and the two BA subjects contribute \(2(-2)=-4\), giving \(4-4=0\).

The sequence–period product sums to zero within each sequence because period codes \(-1\) and \(+1\) occur once per subject. The sequence–treatment product also sums to zero within each subject because each subject receives both treatments. Each contrast column has eight entries whose squares equal one, so its squared length is eight; the intercept column also has squared length eight. Thus:

$$ X^\mathsf{T}X= \begin{pmatrix} 8&0&0&0\\ 0&8&0&0\\ 0&0&8&0\\ 0&0&0&8 \end{pmatrix}. $$

The columns are mutually orthogonal in this balanced allocation. This calculation concerns the fixed-effects design only; it does not turn the eight observations into eight independent subjects. There are four subjects, each contributing two measurements.

What the Orthogonality Means for Crossover Contrasts

A direct view comes from each subject’s treatment difference, defined as the log endpoint on B minus the log endpoint on A. For an AB subject, that difference is the period 2 observation minus the period 1 observation. For a BA subject, it is the period 1 observation minus the period 2 observation. If the treatment effect is \(\delta\) and the period 2 minus period 1 effect is \(\pi\), the model implies:

$$ \begin{aligned} \overline{D}_{AB}&=\delta+\pi,\\ \overline{D}_{BA}&=\delta-\pi. \end{aligned} $$

The sequence-specific average differences contain the period effect with opposite signs. With equal sequence counts, averaging those sequence means cancels the period contribution and leaves the treatment contrast. Their difference, in turn, isolates the period contrast. This is the data-level counterpart of the zero treatment–period cross-product.

Worked Example: Separating Treatment and Period Contrasts

Consider hypothetical log endpoints from two subjects per sequence. In sequence AB, subject 1 has log A \(=1.00\) in period 1 and log B \(=1.18\) in period 2; subject 2 has log A \(=1.05\) and log B \(=1.27\). In sequence BA, subject 1 has log B \(=1.40\) in period 1 and log A \(=1.30\) in period 2; subject 2 has log B \(=1.32\) and log A \(=1.18\). The endpoint is expressed on the natural-log scale relative to a consistent unit.

The B-minus-A differences in AB are \(1.18-1.00=0.18\) and \(1.27-1.05=0.22\), giving \(\overline{D}_{AB}=(0.18+0.22)/2=0.20\). In BA they are \(1.40-1.30=0.10\) and \(1.32-1.18=0.14\), giving \(\overline{D}_{BA}=(0.10+0.14)/2=0.12\).

The estimated treatment contrast is the equally weighted average of the two sequence means:

$$ \widehat{\delta}=\frac{0.20+0.12}{2}=0.16. $$

The period 2 minus period 1 contrast is \(\widehat{\pi}=(0.20-0.12)/2=0.0400\). The equal weighting is appropriate here because the sequence counts are equal. Back-transforming the treatment contrast gives \(\exp(0.16)=1.174\), so the estimated B-to-A geometric-mean ratio is 1.174, or about 17.4% higher for B. This is a point estimate, not a significance test or a confidence interval; inference still requires the appropriate crossover error term and degrees of freedom.

Why the Simplification Has Limits

Orthogonality is a geometric statement about columns of a design matrix. It simplifies estimation and means that, in the balanced fixed-effects design, fitted treatment and period contrasts are not confounded with one another by unequal allocation. Several qualifications matter in practice:

  • It does not remove within-subject dependence. Each subject contributes two observations. The subject effect and the treatment-test error term must be handled as required by the crossover model; treating all measurements as independent would give an incorrect analysis.
  • It does not make every effect separately estimable under every model. Sequence is a between-subject factor, whereas treatment and period vary within subjects. A subject-specific fixed intercept would absorb the sequence indicator because each subject belongs to only one sequence. The usual random-subject formulation and its error structure matter.
  • It relies on the model being appropriate. A common additive treatment effect does not represent a treatment-by-period interaction. Unmodeled carryover, treatment-dependent residual variances, or other violations are not repaired by equal allocation.
  • It can be lost with incomplete or unequal data. If sequence counts differ, or if observations are missing so that the row pattern is no longer balanced, some cross-products need not be zero. Orthogonality should be checked for the observations actually analyzed, not inferred solely from the planned allocation.

A key contrast is between a balanced complete design and an unbalanced observed data set. When sequence counts differ, the treatment–period cross-product no longer cancels in general, and the fixed-effect estimates can depend on how the model is parameterized and adjusted. That situation calls for explicit attention to the analysis of unbalanced data rather than assuming the balanced-design simplifications still apply.

Worked Example: How Unequal Sequence Counts Break a Cross-Product

Suppose a hypothetical complete-data design has two AB subjects but only one BA subject. Each subject still contributes both periods. For each AB subject, the two row-wise products \(pt\) sum to \(+2\); for each BA subject, they sum to \(-2\). Therefore:

$$ \sum pt=2(2)+1(-2)=2\ne 0. $$

The period and treatment columns are no longer orthogonal. In contrast, with two subjects in each sequence the same calculation is \(2(2)+2(-2)=0\). This example does not specify a preferred sums-of-squares method or an adjustment for the unequal design; it shows why one cannot use the balanced-design orthogonality argument once the sequence contributions fail to cancel.

Diagnostics and a Practical Check

Before relying on balanced-design simplifications, verify the actual allocation and analysis rows. Confirm that both sequences have the same number of subjects, that each included subject has observations in both periods, and that the treatment order matches the sequence labels. Then form the coded fixed-effects columns and calculate their sums and cross-products. A nonzero cross-product is direct evidence that the corresponding columns are not orthogonal in the analyzed data.

Also check whether the scientific and statistical assumptions support the chosen additive crossover model. Orthogonal columns do not demonstrate absence of carryover or treatment-by-period interaction, and they do not establish normality or equal residual variance. Those are model questions, not allocation arithmetic. Finally, retain the distinction between fixed-effect geometry and inference: the earlier material on choosing the treatment-test error term establishes that the treatment test must use its crossover-appropriate error term and degrees of freedom, even when the fixed-effects columns are orthogonal.

Key takeaway: In a complete two-period AB/BA crossover with equal numbers of subjects per sequence, effect-coded sequence, period, and treatment columns are mutually orthogonal after accounting for the intercept. The cancellation of the treatment–period cross-product is the central reason balanced crossover ANOVA simplifies. Orthogonality is not independence, does not validate the model, and does not replace correct error-term selection.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. In a balanced AB/BA crossover with \(n\) subjects per sequence, why is the treatment–period cross-product zero?
  2. Does orthogonality of the fixed-effects columns imply that the two observations from each subject are independent? Explain.
  3. Suppose there are three AB subjects and two BA subjects, all with complete measurements. Calculate \(\sum pt\) using the coding in this tutorial.
  4. What does a treatment contrast of \(0.10\) on the natural-log scale imply for the back-transformed B-to-A ratio?

Solutions. (1) The AB sequence contributes \(2n\) to \(\sum pt\), while BA contributes \(-2n\), so the sum is \(2n-2n=0\). (2) No. Orthogonality describes fixed-effect design columns; repeated observations from a subject remain dependent under the subject-effect model. (3) The sum is \(3(2)+2(-2)=6-4=2\), so the columns are not orthogonal. (4) The ratio is \(\exp(0.10)=1.105\), approximately 1.105, meaning the estimated geometric mean for B is about 10.5% higher than for A. This point estimate alone gives no information about its uncertainty or statistical significance.