Why Pairing Changes the Uncertainty
In a crossover study, a subject contributes responses under more than one formulation. Those responses are paired: a subject who tends to have higher responses under one formulation may also tend to have higher responses under the other. A model that treats the observations as unrelated discards this dependence and can misstate the uncertainty of the formulation contrast.
The key question is not simply how variable responses are across subjects. It is how variable the within-subject difference is. A subject-specific effect shared by both formulations can make each response variable while contributing nothing to their difference. Conversely, subjects can differ in their formulation contrasts, and the covariance between formulation-specific responses determines how much that difference varies.
A Model for Paired Formulation Responses
Suppose \(Y_{iT}\) and \(Y_{iR}\) are responses for subject \(i\), measured on a suitable analysis scale. For a log-transformed exposure measure, for example, their difference is a log-scale test-to-reference contrast. The fixed formulation effect represents the average contrast; subject-specific random effects represent how individual response patterns vary around that average.
One direct specification is
Here \(\mu_T\) and \(\mu_R\) are fixed mean responses, \(u_{iT}\) and \(u_{iR}\) are subject-specific deviations, and \(\varepsilon_{iT}\) and \(\varepsilon_{iR}\) are residual deviations not represented by those random effects. The model is meaningful only with assumptions about these components. A common formulation assumes the subject effects have mean zero and covariance matrix
and that residuals have mean zero and covariance matrix \(R\). Subject effects and residuals are assumed independent, and different subjects are assumed independent after relevant fixed design terms have been included. The covariance matrices must be positive semidefinite; in particular, \(\sigma_{TR}^2\leq \sigma_T^2\sigma_R^2\). The residual covariance structure must also reflect the measurements actually modeled, not be selected just to obtain a preferred standard error.
In crossover data, the fixed part of a model may need to account for design features such as period. The paired contrast below is interpreted conditional on an adequate fixed-effects specification and on the study design supporting the comparison. The focus here is the covariance contribution to its uncertainty, not the selection of those design terms.
Deriving the Contrast Variance
Subtract the reference response from the test response for the same subject. The fixed part is \(\mu_T-\mu_R\); the random subject component is \(u_{iT}-u_{iR}\). The residual difference is \(\varepsilon_{iT}-\varepsilon_{iR}\). For any two random variables \(A\) and \(B\), \(\operatorname{Var}(A-B)=\operatorname{Var}(A)+\operatorname{Var}(B)-2\operatorname{Cov}(A,B)\). Applying that identity gives the subject-effect contribution
The residual contribution is \(\operatorname{Var}(\varepsilon_{iT})+\operatorname{Var}(\varepsilon_{iR})-2\operatorname{Cov}(\varepsilon_{iT},\varepsilon_{iR})\). Under independence of the subject effects and residuals, these two contributions add to give the variance of the paired response difference. In matrix notation, if \(c=(1,-1)^\mathsf{T}\), the subject-effect contribution is \(c^\mathsf{T}Gc\); the residual contribution is \(c^\mathsf{T}Rc\).
This result explains the role of a random intercept. In the alternative coding
\(b_{0i}\) is a shared subject effect and \(b_{1i}\) is a subject-specific deviation in the test-versus-reference contrast. Subtraction gives \(Y_{iT}-Y_{iR}=(\mu_T-\mu_R)+b_{1i}+\varepsilon_{iT}-\varepsilon_{iR}\): the shared \(b_{0i}\) cancels exactly. The contrast variance therefore includes the variance of \(b_{1i}\), along with the residual contrast variance, but not the variance of the shared intercept by itself.
Worked Example: Shared Subject Effects Cancel
Suppose a hypothetical model has a shared random intercept with variance \(0.12\) log-units squared. Each formulation response also has an independent residual variance of \(0.04\) log-units squared. Assume the residuals are independent across formulations, the shared intercept is independent of residuals, and responses from different subjects are independent. There are \(n=12\) subjects. What is the standard error of the mean paired contrast if there is no additional random formulation effect?
For one response, the shared intercept contributes variance \(0.12\). In the paired difference, its contribution is \(0.12+0.12-2(0.12)=0\), because the same intercept occurs in both responses. The residual difference has variance \(0.04+0.04=0.08\) log-units squared.
Thus the variance of the sample mean contrast is \(0.08/12=0.006667\) log-units squared, and its standard error is
The calculation relies on the stipulated residual independence and common variance. If the paired residuals were correlated, their covariance would also enter the difference variance. The large marginal subject variance does not, by itself, imply a large uncertainty for the paired contrast.
Worked Example: Covariance Changes the Standard Error
Consider a hypothetical fitted model for paired responses across \(n=16\) subjects. Let the subject-specific test and reference deviations have variances \(0.0900\) and \(0.0625\) log-units squared, respectively, and covariance \(0.0400\) log-units squared. Suppose these deviations describe the full subject-level paired variation for this calculation, with no separate residual contribution. The estimated mean log contrast is \(0.1200\).
The variance of a subject’s contrast is
The standard error of the estimated mean contrast is therefore
If the covariance were incorrectly set to zero, the contrast variance would instead be \(0.0900+0.0625=0.1525\), and
Thus, in this example, ignoring the positive covariance overstates the standard error. For illustration, using a \(t\) critical value of \(2.131\) with \(df=15\), the model-based interval is \(0.1200\pm 2.131(0.06731)\), or approximately \([-0.0235,\,0.2635]\) log units. Under the model and the stated degrees of freedom, this is a 95% confidence interval for the mean log contrast. It is not a probability statement that the fixed contrast lies in this particular interval.
Working Directly With Paired Contrasts
When each subject has one response under each formulation, the observed paired differences \(D_i=Y_{iT}-Y_{iR}\) provide a direct view of the quantity whose uncertainty matters. Their sample standard deviation \(s_D\) estimates the across-subject standard deviation of the paired differences, and the estimated standard error of their mean is \(s_D/\sqrt{n}\), under independent, identically distributed subject contrasts with finite variance. This paired analysis and a correctly specified model for the same contrast target can agree. The model becomes useful when it represents additional structure or accommodates an unbalanced pattern, but its covariance assumptions must then be checked.
Worked Example: Estimating Uncertainty From Four Paired Differences
In a hypothetical small illustration, the paired log-scale differences for four subjects are \(0.02,\ 0.10,\ 0.14,\) and \(0.22\). Assume for this calculation that subjects are independent and that these differences are observations from a common distribution with finite variance.
The sample mean is \(\bar{D}=(0.02+0.10+0.14+0.22)/4=0.1200\) log units. The squared deviations from the mean are \(0.0100,\ 0.0004,\ 0.0004,\) and \(0.0100\). Therefore,
Using \(t_{0.975,3}=3.182\), the 95% \(t\) interval is \(0.1200\pm 3.182(0.04163)\), or approximately \([-0.0125,\,0.2525]\) log units. This interval uses the usual independent, normally distributed paired-difference model for exact small-sample \(t\) inference. With only four subjects, normality and outlier sensitivity cannot be assessed reliably; the numerical interval should not be treated as robust evidence about a larger population.
Model Checks, Alternatives, and Limits
A random-effects covariance estimate is useful only if the model is compatible with the observed paired data. Diagnostics should examine both the fitted responses and the implied contrasts. Plot subject-level test and reference responses against one another, and inspect paired differences for unusual values, trends, or spread that changes across the response range. Compare observed variability in differences with the model-implied variance \(c^\mathsf{T}(ZGZ^\mathsf{T}+R)c\), where \(Z\) maps subject effects to responses. Check whether the fitted covariance matrix is positive semidefinite and whether an estimated correlation is near its allowed boundary.
A covariance near a boundary, a singular fit, or large uncertainty in the covariance estimate can signal that the data do not support the chosen random-effects structure. A model that omits real covariance can distort the contrast standard error; a model with more covariance parameters than the data can estimate reliably can also be unstable. Inspect residuals for systematic structure and consider whether the assumed independence across subjects and the fixed-effects specification are credible. Diagnostics can reveal incompatibility, but cannot prove that the model assumptions are true.
The main alternatives answer related but not identical modeling needs:
- Paired-difference analysis estimates the mean and variability of \(D_i\) directly. It makes the covariance contribution implicit in the observed differences, but does not separately estimate the test and reference variances or their covariance.
- A random-intercept-only model represents shared subject-to-subject response variation. If it assumes no subject-specific formulation contrast, it does not capture additional variation in \(D_i\) beyond its residual structure.
- A model with formulation-specific subject effects or a random contrast can represent heterogeneity in paired responses explicitly. It requires enough information to estimate its covariance structure and is more vulnerable to instability when the design is sparse.
- An analysis treating the two responses as independent discards the pairing. It is generally not an appropriate substitute when the same subjects contribute both formulation responses, because it omits their covariance.
These approaches do not make a poorly specified design or missing information disappear. The standard error depends on the target contrast, the observed data, and assumptions about random effects, residuals, and subject independence. In particular, the covariance estimated for one response scale or model need not apply to another. This tutorial concerns uncertainty in a within-subject contrast; it does not by itself define an equivalence decision rule or establish that a formulation comparison is bioequivalent.
Check Your Understanding
Use the model assumptions stated in each question. Answers follow the questions.
- If the test and reference subject effects have variances \(0.16\) and \(0.09\), and covariance \(0.06\), what is the variance of their difference?
- Why does a shared subject random intercept not contribute to the paired contrast variance?
- For \(n=25\) independent subjects and a paired-difference variance of \(0.10\) log-units squared, calculate the standard error of the mean difference.
- Name one diagnostic sign that a fitted random-effects covariance structure may be unsupported by the data.
Solutions. (1) \(0.16+0.09-2(0.06)=0.13\) log-units squared. (2) It appears with the same coefficient in both formulation responses, so subtraction gives \(b_{0i}-b_{0i}=0\). (3) \(SE=\sqrt{0.10/25}=\sqrt{0.004}=0.06325\) log units. (4) A singular fit, an estimated covariance matrix at its positive-semidefinite boundary, or a covariance estimate with very large uncertainty can indicate that the specified structure is not well supported.