Tutorials › Bioavailability and Bioequivalence › Detecting Unequal Residual Variances Across Formulations

Log-Scale Analysis and ANOVA · Tutorial 197 of 399

Detecting Unequal Residual Variances Across Formulations

Learn to assess whether test and reference observations need separate residual variances, and how to compare the models while respecting the crossover design.

Intermediate 12 min read

What You'll Learn

  • Define common-variance and formulation-specific residual-variance models for log-scale crossover data
  • Distinguish residual variance from total between-subject and within-subject variability
  • Use formulation-stratified residual summaries and plots as diagnostic evidence
  • Compare nested variance models with a likelihood-ratio test under stated assumptions
  • Explain why a simple variance-ratio F test can be misleading for crossover residuals
  • Recognize when a variance-model change may be compensating for a misspecified mean or covariance structure

Why Compare Residual Variances by Formulation?

A crossover analysis commonly models a log-transformed pharmacokinetic endpoint, such as log AUC or log Cmax. Its mean model accounts for effects such as formulation, period, and sequence, while its covariance model accounts for repeated observations from the same subject. A further assumption may be that the remaining, conditional residual variability is the same under test and reference. If that assumption is poor, standard errors and likelihood-based comparisons that rely on the common-variance model may be unreliable.

The diagnostic question is specific: after fitting an appropriate mean and within-subject covariance structure, do test and reference observations have different residual variances? A difference in observed spread alone does not answer this. Unequal means, an omitted treatment-by-period effect, influential subjects, or a misspecified covariance structure can also produce formulation-specific patterns in residuals.

Definition: A common residual-variance model assigns the same conditional residual variance, \(\sigma^2\), to test and reference observations. A formulation-specific residual-variance model assigns variances \(\sigma_T^2\) and \(\sigma_R^2\), respectively. These are conditional residual variances after accounting for the specified mean and subject-level covariance structure; they are not necessarily the total marginal variances of the observations.

Model Setup and Assumptions

Let \(y_{ij}\) be the log endpoint for subject \(i\) in period \(j\), and let \(F_{ij}\) identify the formulation administered. A convenient illustration is a mixed model with a subject random intercept:

$$ y_{ij}=\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta}+b_i+\varepsilon_{ij},\qquad b_i\sim N(0,\tau^2),\qquad \varepsilon_{ij}\sim N(0,\sigma_{F_{ij}}^2). $$

Here \(\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta}\) represents the fixed-effects mean structure, \(b_i\) induces within-subject correlation, and the residual variance is indexed by formulation. In the common-variance model, \(\sigma_T^2=\sigma_R^2=\sigma^2\). In the formulation-specific model, \(\sigma_T^2\) and \(\sigma_R^2\) are estimated separately. More elaborate crossover models can use another prespecified subject covariance structure; the comparison still concerns the residual variances while holding the mean and the rest of the covariance specification fixed.

The comparison assumes that the mean model is adequate, subjects are independent of one another, and the within-subject covariance structure is specified appropriately. For a Gaussian likelihood analysis, the conditional residual distributions are also assumed normal. The variance model must be identifiable: the data need enough observations under each formulation, with the design and covariance structure able to distinguish residual from subject-level variability. In small samples, likelihood-ratio reference distributions can be inaccurate, so the test should be treated cautiously or calibrated by a suitable method such as a parametric bootstrap.

A random subject intercept contributes to the marginal variance of every observation, while the formulation-specific residual term contributes an additional variance that depends on treatment. Consequently, a difference in total observed spread is not automatically a difference in residual variance. This distinction matters especially in replicate designs or models with random treatment effects.

Diagnose Before Testing

Begin with residuals from the fitted crossover model, not with unadjusted log observations. Compare residual spread by formulation using plots and summaries, while retaining subject and period information. A residual-versus-fitted plot coloured by formulation can reveal whether one formulation has a wider band of residuals across the fitted range. A subject-linked plot can show whether an apparent difference is driven by a few paired observations or by a general pattern.

Useful summaries include formulation-specific residual standard deviations and their ratio. They are descriptive diagnostics, not automatically unbiased estimates or a formal test: fitted residuals have constraints imposed by estimation, and repeated observations from a subject are correlated. Interpret the plot alongside the mean-model diagnostics already used for log-scale crossover models. In particular, a systematic residual trend or period-specific pattern suggests investigating the mean or covariance model before attributing the spread to formulation.

Worked Example: A Descriptive Spread Comparison

Suppose a hypothetical diagnostic extract contains six approximate residuals per formulation, in log-endpoint units. The reference residuals are \(-2,-1,0,0,1,2\), and the test residuals are \(-4,-2,0,0,2,4\). For a quick descriptive comparison, calculate the sample variance within each group using the residual mean and the divisor \(n-1\).

Both residual sets have mean zero. For reference, the sum of squared deviations is \(4+1+0+0+1+4=10\), so \(s_R^2=10/(6-1)=2.00\) squared log units. For test, the sum is \(16+4+0+0+4+16=40\), so \(s_T^2=40/5=8.00\) squared log units.

The descriptive variance ratio is \(s_T^2/s_R^2=8/2=4.00\), and the corresponding standard-deviation ratio is \(\sqrt{4}=2.00\). Thus this small hypothetical extract shows twice the residual standard deviation for test. It does not establish a statistically reliable formulation difference: these are fitted residuals, and the observations may be correlated within subjects. The next step is to inspect the full model-based diagnostics and compare appropriate covariance models.

Comparing the Nested Variance Models

To formally compare the models, fit them with the same fixed-effects mean structure and the same subject covariance structure. The common-variance model is nested in the formulation-specific model because it is obtained by imposing the single constraint \(\sigma_T^2=\sigma_R^2\). Let \(\ell_C\) and \(\ell_S\) denote the maximized log likelihoods under the common and separate variance models. The likelihood-ratio statistic is

$$ \Lambda=2(\ell_S-\ell_C). $$

Under the null hypothesis \(H_0:\sigma_T^2=\sigma_R^2\), the alternative is \(H_a:\sigma_T^2\ne\sigma_R^2\). With regularity conditions and enough independent subjects, \(\Lambda\) is approximately distributed as a chi-squared random variable with one degree of freedom under \(H_0\). The one degree of freedom comes from releasing one equality constraint. The approximation is not a guarantee of accurate calibration in a small study.

A short justification follows from the nested models: the separate-variance model includes every parameter setting allowed by the common-variance model, so its maximized likelihood cannot be smaller. Thus \(\ell_S\geq\ell_C\) and \(\Lambda\geq0\). Under the null and regular large-sample conditions, the likelihood gain from estimating one additional free parameter has the chi-squared-one reference distribution. This is an approximate model-comparison test, not a test of whether the formulations have equal mean exposure.

Maximum likelihood can be used for both fits. Restricted maximum likelihood (REML) can also be used for this comparison when the fixed-effects design is identical in the two models; changing the fixed-effects structure changes the restricted likelihood basis and makes that comparison inappropriate. Whichever method is chosen, keep all other model features fixed so that a likelihood difference is attributable to the variance specification rather than to several simultaneous changes.

Worked Example: Likelihood-Ratio Comparison

In a hypothetical crossover analysis, the common-variance model has maximized log likelihood \(\ell_C=-104.0\), while the otherwise identical formulation-specific model has \(\ell_S=-101.8\). The mean structure and subject covariance structure are the same, and the separate model estimates one additional residual-variance parameter.

The statistic is \(\Lambda=2[\ell_S-\ell_C]=2[-101.8-(-104.0)]=2(2.2)=4.40\). With \(df=1\), the approximate chi-squared upper-tail p-value is \(P(\chi^2_1\geq4.40)\approx0.0359\).

At a prespecified \(\alpha=0.05\), this is evidence against equal residual variances under the model and its assumptions. It is not a 3.59% probability that the null hypothesis is true. The conclusion concerns residual spread, not the test-reference mean contrast or bioequivalence. The estimated variances, their ratio, the diagnostic plots, and the study design should also be reported to show the direction and practical size of the difference.

Why the Simple F Test Is Often Not the Answer

For two independent samples of normally distributed observations, an exact variance-ratio test can use \(s_T^2/s_R^2\) and an F distribution with degrees of freedom based on the two sample sizes. Its exactness depends on independent observations, normal populations, and sample variances calculated from those independent observations. Crossover residuals generally do not meet this setup: each subject can contribute both formulations, residuals are estimated after fitting a model, and their covariance may reflect repeated measures.

Therefore, applying an ordinary F test to the two residual columns can give a misleading p-value even if the variance ratio itself is a useful descriptive summary. A model-based likelihood comparison preserves the specified subject covariance structure. Robust alternatives such as Levene-type tests can be useful in appropriate independent-group settings, but applying them directly to correlated crossover residuals does not automatically solve the dependence problem. The analysis must match the sampling and covariance structure.

Worked Example: Reading Variance Estimates in Context

A second hypothetical fitted model reports \(\hat{\sigma}_T^2=0.0144\) and \(\hat{\sigma}_R^2=0.0064\), in squared log-endpoint units. The estimated variance ratio is \(0.0144/0.0064=2.25\). The estimated residual standard deviations are \(\sqrt{0.0144}=0.120\) and \(\sqrt{0.0064}=0.0800\) log units; their ratio is \(0.120/0.0800=1.50\).

In this hypothetical fit, the estimated test residual standard deviation is 50% greater than the reference residual standard deviation, conditional on the model. The variance ratio is 125% greater than one, because \(2.25-1=1.25\). These descriptions refer to different scales and should not be interchanged. Neither estimate alone establishes that the variances differ beyond sampling variation; that conclusion requires uncertainty assessment, such as the nested-model comparison, and checks that the model is adequate.

Failure Modes, Interpretation, and Limitations

  • Comparing raw spreads. Raw observations combine mean differences, subject effects, and residual variation. Compare residuals conditional on the fitted model instead.
  • Ignoring pairing. Treating test and reference residuals as independent can invalidate a simple F-test calculation when the same subjects contribute both formulations.
  • Changing several model features at once. If the fixed effects or subject covariance structure also changes, the likelihood difference no longer isolates the variance assumption.
  • Overinterpreting a small p-value. Statistical evidence for unequal variances does not show that the mean treatment effect is biased, nor does it establish clinical importance. Report the estimated variance ratio and its uncertainty.
  • Using variance heterogeneity to mask a poor mean model. A variance model does not repair omitted period structure, treatment-by-period patterns, or influential observations. Inspect these possibilities before drawing a formulation-specific conclusion.

A formulation-specific residual model can improve the description of uncertainty when the spread genuinely differs, but it costs an additional parameter and may be unstable when data are sparse or highly unbalanced. Conversely, a common-variance model is more parsimonious and may be adequate even when sample variances look different by chance. Model choice should combine the likelihood comparison with residual patterns, design knowledge, parameter precision, and the consequences for the target inference. A non-significant test is not proof of equal variances; it may reflect limited information.

Key takeaway: Diagnose formulation-specific residual spread using model-adjusted, subject-aware information. Compare common and separate variance models while holding the mean and remaining covariance structure fixed, and interpret the result as evidence about residual variability—not as a test of equal mean exposure.

Check Your Understanding

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

  1. What single constraint makes the common-variance model a special case of the formulation-specific model?
  2. Why is a fourfold residual variance ratio not the same as a fourfold residual standard-deviation ratio?
  3. A nested comparison gives \(\ell_C=-80.0\) and \(\ell_S=-79.0\). Calculate the likelihood-ratio statistic and state its approximate reference degrees of freedom.
  4. Why might an ordinary F test applied to crossover residuals have an invalid reference distribution?

Solutions. (1) The constraint is \(\sigma_T^2=\sigma_R^2\), reducing the separate-variance model by one free parameter. (2) Standard deviation is the square root of variance, so a variance ratio of 4 corresponds to a standard-deviation ratio of \(\sqrt{4}=2\). (3) \(\Lambda=2[-79.0-(-80.0)]=2.00\), with approximately \(df=1\) because one variance-equality constraint is released. (4) The observations may be correlated within subjects, and fitted residuals are not independent raw observations; the independent-normal-sample assumptions behind the exact F test therefore need not hold.