Tutorials › Bioavailability and Bioequivalence › Diagnosing Random-Effects And Covariance Structures

Model-Based Bioequivalence · Tutorial 314 of 399

Diagnosing Random-Effects And Covariance Structures

You will learn to diagnose random-effects and covariance structures by examining parameter uncertainty, shrinkage, correlations, and simulation-based evidence.

Advanced 12 min read

What You'll Learn

  • Relate random-effects variances to subject-level formulation contrasts.
  • Distinguish parameter uncertainty from the estimated size of variability.
  • Interpret shrinkage as a measure of information about individual effects.
  • Assess whether estimated random-effects correlations are trustworthy.
  • Use simulation diagnostics to reveal unstable covariance estimates.
  • Compare simpler and more flexible random-effects structures.

Why Diagnose the Random-Effects Structure?

A mixed-effects bioequivalence model represents both average formulation behavior and variation among subjects. The random-effects structure specifies which subject-specific quantities can vary and how those quantities vary together. This choice matters: a model can estimate the average formulation contrast precisely while providing weak evidence about the variability of individual formulation responses. That distinction is especially important when the bioequivalence question involves variability as well as a population-average exposure ratio.

Diagnosis is not a search for the most complicated covariance matrix that software can fit. It is an assessment of whether the estimated variability is supported by the design and data, whether its uncertainty is acceptable for the intended interpretation, and whether model-generated data show the same relevant patterns as the observed data. The emphasis here is on random effects and their covariance, not on choosing among residual error models.

Definition: A random-effects structure specifies the subject-level effects allowed to vary across subjects and their joint distribution. If the subject-level random-effects vector is \(b_i\), a common assumption is \(b_i \sim N(0,G)\), where \(G\) is a positive-semidefinite covariance matrix. Its diagonal entries are variances; its off-diagonal entries are covariances.

For example, a model may allow a subject-specific overall exposure level and a subject-specific formulation response. Their covariance describes whether subjects with higher overall exposure tend, on average, to have higher or lower formulation responses. It is not the same quantity as the residual variation among observations after accounting for the subject effects.

Connect the Covariance Structure to the Bioequivalence Contrast

Consider a simplified log-exposure model with reference formulation coded \(x=0\) and test formulation coded \(x=1\):

$$ Y_{ij} = \mu + \delta x_{ij} + b_{0i} + b_{Fi}x_{ij} + \varepsilon_{ij}. $$

Here \(Y_{ij}\) is a log-exposure value for subject \(i\) in observation \(j\), \(\delta\) is the population-average test-minus-reference contrast, \(b_{0i}\) is a subject-specific level effect, and \(b_{Fi}\) is a subject-specific deviation in the formulation contrast. The vector \((b_{0i},b_{Fi})^\mathsf{T}\) has covariance matrix

$$ G = \begin{pmatrix} \tau_0^2 & \tau_{0F}\\ \tau_{0F} & \tau_F^2 \end{pmatrix}. $$

The population-average log contrast is \(\delta\), while the subject-specific log contrast is \(\delta+b_{Fi}\). Thus \(\tau_F^2\), not \(\tau_0^2\), is the random-effects variance directly describing between-subject heterogeneity in formulation response under this coding. The estimated geometric mean ratio corresponding to the fixed contrast is \(\exp(\delta)\); the variance of the subject-specific contrast is on the log scale.

The covariance \(\tau_{0F}\) can matter for the joint distribution of subject-specific levels and responses. But a covariance estimate is useful only if the data contain information about both random effects and their relationship. If one variance is close to zero, the corresponding correlation can be highly unstable even when the software reports a numerical value.

Parameter Uncertainty Is Part of the Diagnosis

A variance estimate is not a complete description of what the data say. Its uncertainty should be examined alongside its magnitude. Standard errors and confidence intervals can reveal that a seemingly substantial estimate is imprecise. For variance parameters, likelihood-based profile intervals are often more informative than symmetric Wald intervals, because a variance cannot be negative and its sampling distribution may be asymmetric near zero.

For two random effects, the estimated correlation is

$$ \hat{\rho}_{0F} = \frac{\hat{\tau}_{0F}}{\sqrt{\hat{\tau}_0^2\hat{\tau}_F^2}}. $$

This calculation is valid when the estimated variances are positive. It does not by itself establish that the correlation is well estimated. Assess its uncertainty as well, using an appropriate likelihood-based interval or other method supported by the fitted model. Estimates near \(-1\) or \(1\), very wide intervals, or large changes under modest model changes are warning signs. A correlation is not meaningful as a stable scientific finding when one of its associated variances is essentially zero.

Worked Example: A Plausible Estimate With Wide Uncertainty

Suppose a hypothetical replicate-design analysis estimates a subject-level log-exposure variance of \(\hat{\tau}_F^2=0.040\) log-units squared. A likelihood-based 95% interval for this variance is \([0.005, 0.160]\). The estimated covariance between subject level and formulation response is \(0.030\), while the estimated subject-level variance is \(0.090\). Assess what these estimates imply.

Translate the variability to a standard deviation. The estimated standard deviation of subject-specific log formulation responses is \(\sqrt{0.040}=0.200\) log-units. Transforming the interval endpoints gives \([\sqrt{0.005},\sqrt{0.160}]=[0.0707,0.400]\) log-units. The interval is broad: the data are compatible with substantially different magnitudes of subject-to-subject variation.

Calculate the estimated correlation.

$$ \hat{\rho}_{0F} = \frac{0.030}{\sqrt{0.090(0.040)}} = \frac{0.030}{0.060}=0.500. $$

The point estimate is a positive correlation of 0.500. It suggests that, under this model, subjects with higher overall log exposure tend to have higher formulation-response deviations. But without an uncertainty interval for this correlation, it would be premature to treat that pattern as established. The wide interval for \(\tau_F^2\) is already a reason to scrutinize the precision of related covariance quantities.

Conclusion. The fitted model estimates nonzero heterogeneity, but the interval shows appreciable uncertainty about its size. The point estimate of the correlation is interpretable as a model estimate, not as proof of a stable population relationship.

Shrinkage and Information About Individual Effects

In a mixed model, estimates of individual random effects are typically conditional predictions, often called empirical Bayes estimates or best linear unbiased predictions under the relevant assumptions. These estimates are pulled toward the population mean of zero. This shrinkage reflects that each subject’s observations provide limited information about that subject’s random effect, while the model also uses the estimated population distribution.

A simple normal-means calculation shows the mechanism. Suppose an individual formulation deviation \(b_i\) has distribution \(N(0,\tau^2)\), and a noisy subject-level estimate \(u_i\), conditional on \(b_i\), has distribution \(N(b_i,v)\). With independent normal variation, the conditional mean of \(b_i\) given \(u_i\) is

$$ E(b_i\mid u_i) = \frac{\tau^2}{\tau^2+v}u_i. $$

The multiplier \(\lambda=\tau^2/(\tau^2+v)\) is between zero and one. When the subject-level estimate is noisy relative to the population variance, \(\lambda\) is small and the prediction is strongly shrunk toward zero. This formula is an illustration under the stated normal model; in a full mixed model, shrinkage depends on the design, the covariance structure, and the information from all observations.

Worked Example: Quantifying Shrinkage of a Subject Effect

In a hypothetical analysis, the estimated variance of subject-specific formulation responses is \(\hat{\tau}^2=0.040\) log-units squared. For one subject, the data yield a noisy estimate \(u_i=0.200\) log-units with sampling variance \(v=0.090\) log-units squared. Use the normal-means approximation to calculate the shrunk estimate.

The shrinkage multiplier is

$$ \lambda = \frac{0.040}{0.040+0.090} = \frac{0.040}{0.130}=0.3077. $$

Therefore the conditional estimate is

$$ E(b_i\mid u_i) \approx 0.3077(0.200) =0.0615\ \text{log-units}. $$

The raw subject-level estimate is \(0.200\) log-units, whereas the model-based estimate is \(0.0615\) log-units. This degree of shrinkage indicates that these observations provide limited information about this subject’s deviation relative to the assumed population variability. It does not, by itself, show that the population variance is wrong or that the population-average formulation contrast is biased.

Shrinkage is most useful as a diagnostic when examined across subjects and interpreted alongside the design. Extensive shrinkage of individual effects can arise because there are few informative observations per subject, because the random-effects variance is small compared with observation-level noise, or because the model structure does not match the information in the data. Shrinkage alone cannot identify which explanation is responsible.

Simulation-Based Diagnostics

A practical diagnostic is to simulate data from the fitted model under the actual study design, then refit the same model to each simulated data set. Each simulation should reproduce the fixed design features, such as subjects, periods, formulation assignments, and observation times, while generating random effects under the fitted \(G\). The purpose is to see whether the fitting procedure repeatedly recovers the kinds of variance and covariance estimates seen in the original analysis.

Useful summaries include the frequency of variance estimates at or near zero, the frequency of correlations near the boundaries, the spread of estimated variances and correlations, convergence failures, and the amount of shrinkage across simulated subjects. These checks are most informative when the simulation and refitting steps match the analysis being diagnosed. They are not a substitute for reasoning about the design, and they do not prove that the fitted model is true.

Worked Example: Checking Covariance Stability by Simulation

Suppose a hypothetical fitted model has \(\hat{\tau}_F^2=0.040\) and \(\hat{\rho}_{0F}=0.500\). The analyst generates and refits 100 simulated data sets, preserving the study’s replicate structure. The formulation-response variance is estimated at the boundary of zero in 24 fits; in 17 fits the absolute estimated correlation exceeds 0.95. No fit fails to converge.

The boundary frequency is \(24/100=0.24\), or 24%. The frequency of extreme correlations is \(17/100=0.17\), or 17%. These results indicate that, under the fitted model and design, the estimation procedure often has difficulty separating a positive formulation-response variance from zero and often produces correlations close to their limits.

The fact that all fits converged does not remove this concern: numerical convergence does not guarantee precise or stable covariance estimates. The diagnostic points to weak information about at least part of the covariance structure. The analyst should report that uncertainty, inspect whether simpler scientifically defensible structures yield more stable estimates, and avoid treating the original correlation estimate of 0.500 as precise merely because it is interior to the parameter range.

Choosing and Comparing Covariance Structures

The alternatives should correspond to different scientific assumptions, rather than being selected solely by which model produces the most favorable bioequivalence result. Common options include:

  • Random intercept only: subjects differ in overall level, but the formulation contrast is assumed not to vary across subjects.
  • Random intercept and random formulation effect with diagonal \(G\): both quantities vary, but their covariance is fixed at zero.
  • Unstructured \(G\): both variances and their covariance are estimated, allowing the two subject effects to be correlated.

A random-intercept-only structure may be suitable if the target is only a population mean and the design does not support estimating response heterogeneity. It is not suitable for a question that explicitly requires subject-by-formulation variability if it rules that variability out by assumption. A diagonal structure is more parsimonious than an unstructured structure, but setting the covariance to zero is also an assumption, not a neutral default.

Compare candidate structures using scientific relevance, parameter uncertainty, stability across reasonable specifications, and simulation diagnostics. More parameters can describe richer patterns, but also require more information. Conversely, a simpler structure can conceal variability relevant to individual bioequivalence if it omits subject-by-formulation effects. The choice should reflect the estimand and the information supplied by the design.

Deriving Why the Within-Subject Contrast Is Informative

Under the model above, write the fitted-scale values for a subject’s reference and test observations, temporarily suppressing period terms and residual errors:

$$ Y_{iR}=\mu+b_{0i}, \qquad Y_{iT}=\mu+\delta+b_{0i}+b_{Fi}. $$

Subtract the reference value from the test value:

$$ Y_{iT}-Y_{iR} =(\mu+\delta+b_{0i}+b_{Fi})-(\mu+b_{0i}) =\delta+b_{Fi}. $$

The subject-level intercept cancels, so the random variation in the underlying contrast is \(b_{Fi}\), with variance \(\tau_F^2\). This derivation explains why repeated formulation information within subjects is important for estimating formulation-response heterogeneity. In real data, periods, residual errors, missing observations, and the design’s replication pattern affect how precisely that variance can be estimated; the cancellation does not eliminate those sources of uncertainty.

Common Pitfalls and Limitations

  • Reading a point estimate as precision. A positive variance or moderate correlation estimate does not show that it is precisely estimated. Examine uncertainty and stability.
  • Interpreting a boundary correlation literally. When a variance approaches zero, the associated correlation may be poorly defined. A reported value near \(1\) or \(-1\) can reflect weak information rather than a clear biological relationship.
  • Treating shrinkage as evidence of a bad model. Shrinkage is expected when individual observations are noisy. It describes the information about individual effects, not a direct test of model adequacy.
  • Assuming convergence means reliability. An optimizer can converge to a solution even when variance estimates are unstable or weakly informed.
  • Over-interpreting simulations from the fitted model. Such simulations diagnose the behavior of the fitted assumptions under the observed design. They cannot establish that those assumptions are correct.

These diagnostics have limits. A covariance matrix can be estimated with substantial uncertainty even when the fitted model is computationally well behaved. Simulation results depend on the parameter values used to generate data, and a finite number of simulations gives only an approximate picture of estimator behavior. Most importantly, a model-based estimate of heterogeneity is conditional on the chosen model and design; it is not a design-free property inferred without assumptions.

Key takeaway: Diagnose the random-effects structure by asking whether its parameters are estimable with useful precision, whether subject-level predictions show plausible information-dependent shrinkage, and whether simulated data under the fitted model reproduce stable covariance estimates. Relate each variance to the bioequivalence quantity it is meant to describe.

Check Your Understanding

Answer the questions, then compare your reasoning with the solutions below.

  1. In a random-intercept and random-formulation-effect model, which random-effects variance describes heterogeneity in the within-subject formulation contrast? Why?
  2. A variance estimate is 0.010 log-units squared, with a 95% interval from 0.000 to 0.090. What does this interval suggest about the precision of the estimate?
  3. Using the normal-means shrinkage formula, calculate the multiplier when \(\tau^2=0.030\) and \(v=0.070\). What does the multiplier imply?
  4. Why can a correlation estimate near \(1\) be difficult to interpret when one of its associated variances is close to zero?
  5. In 200 simulated refits, 50 formulation-response variance estimates are zero. Calculate the frequency and state what it diagnoses, and what it does not prove.

Solutions. (1) The random formulation-effect variance \(\tau_F^2\), because subtracting the reference value from the test value cancels the subject intercept and leaves the random contrast deviation \(b_{Fi}\). (2) The interval is broad relative to the estimate and includes zero, indicating substantial uncertainty; the data do not pin down the variance precisely. (3) \(\lambda=0.030/(0.030+0.070)=0.300\). The conditional estimate is 30% of the noisy subject-level estimate, indicating substantial shrinkage toward zero under the stated normal model. (4) Correlation divides covariance by the product of standard deviations. If one standard deviation is near zero, the correlation is unstable and may be poorly defined, so a boundary estimate need not indicate a genuine strong relationship. (5) The frequency is \(50/200=0.25\), or 25%. This diagnoses frequent boundary estimates under the fitted model and design, suggesting weak information about the variance. It does not prove that the model is false or establish the true population variance.