Tutorials › Bioavailability and Bioequivalence › Estimating Within-Subject Variance From Replicate Data

Narrow Therapeutic Index Drugs · Tutorial 283 of 399

Estimating Within-Subject Variance From Replicate Data

Derive within-subject variance estimates from replicate observations and determine which variances a crossover design can identify.

Advanced 11 min read

What You'll Learn

  • Derive a within-subject variance estimate from paired replicate observations.
  • Distinguish a centered replicate-difference estimator from an estimator that assumes a known zero mean difference.
  • Use contrasts to determine which within-subject variances a replicate design can estimate.
  • Explain how period effects, correlation, and missing replicates can affect variance estimates.
  • Interpret log-scale variance estimates and their relationship to within-subject coefficients of variation.

Why Replication Matters for Variance Estimation

In a crossover bioequivalence study, observations from the same participant can be more alike than observations from different participants. Replicate administration of a formulation provides information about the variability of that participant’s response across administrations. The key is to separate this within-subject variation from differences among participants and from systematic effects such as period.

For a pharmacokinetic endpoint such as AUC or \(C_{\max}\), analysis commonly uses the natural logarithm of the measured value. Let \(Y_{ifj}\) denote the log endpoint for subject \(i\), formulation \(f\), and replicate occasion \(j\), where \(f\) is test (T) or reference (R). The within-subject variance \(\sigma_{W,f}^2\) describes the variability of repeated log outcomes for formulation \(f\), under a specified model and its assumptions. It is not the total variance across all observations: that total can also include subject, period, and other components.

Definition: A within-subject variance \(\sigma_{W,f}^2\) is the variance of the occasion-specific log outcome for formulation \(f\), after accounting for the modeled systematic effects and subject-level effects. It is expressed in squared log units. For two replicate observations of the same formulation, a difference removes a shared subject effect and can identify this variance when the occasion errors have the required distribution and covariance structure.

The estimates depend on both the design and the model. Replicating reference but not test can estimate reference within-subject variance, but not test within-subject variance by the same direct comparison. Replicating both formulations can estimate both, provided the model distinguishes within-formulation replication from other sources of variation.

Estimating Variance From a Replicate Pair

Suppose each of \(m\) subjects receives formulation \(f\) twice. A simple model for the two log observations is \(Y_{if1}=\mu_f+b_i+\varepsilon_{if1}\) and \(Y_{if2}=\mu_f+b_i+\varepsilon_{if2}\). Here \(\mu_f\) is a common formulation mean, \(b_i\) is a subject effect shared by the pair, and the occasion errors \(\varepsilon_{if1}\) and \(\varepsilon_{if2}\) are independent with mean zero and variance \(\sigma_{W,f}^2\). For this direct calculation, assume no unmodeled occasion effect shifts one member of the pair relative to the other.

Taking the within-subject difference \(D_{if}=Y_{if1}-Y_{if2}\) removes both the common formulation mean and the shared subject effect. Under the assumptions, \(D_{if}=\varepsilon_{if1}-\varepsilon_{if2}\), so its variance is \(2\sigma_{W,f}^2\). If the differences have an unknown common mean, estimate their variance with the sample variance \(s_{D,f}^2\), then divide by two.

$$ \widehat{\sigma}_{W,f}^2 = \frac{s_{D,f}^2}{2} = \frac{\sum_{i=1}^{m}(D_{if}-\bar{D}_f)^2}{2(m-1)} $$

This estimator is unbiased under the stated model. If the mean difference is known to be exactly zero, an uncentered alternative is available: \(\widehat{\sigma}_{W,f}^2=\sum_i D_{if}^2/(2m)\). That alternative uses the known-zero assumption rather than estimating the mean difference from the data. Centering is generally important when a common nonzero difference could arise, for example, from a systematic period contrast.

Why the Divisor and Degrees of Freedom Matter

For normally distributed occasion errors, a replicate difference is normal with variance \(2\sigma_{W,f}^2\). When its mean is unknown and estimated by \(\bar{D}_f\), the sample variance of the \(m\) differences has \(m-1\) degrees of freedom. Consequently,

$$ \frac{(m-1)s_{D,f}^2}{2\sigma_{W,f}^2} = \frac{(m-1)\widehat{\sigma}_{W,f}^2}{\sigma_{W,f}^2} \sim \chi^2_{m-1}. $$

If instead the mean difference is known to be zero and the uncentered estimator is used, then each \(D_{if}^2/(2\sigma_{W,f}^2)\) has a \(\chi^2_1\) distribution. Summing the \(m\) independent terms gives

$$ \frac{m\widehat{\sigma}_{W,f}^2}{\sigma_{W,f}^2} = \sum_{i=1}^{m}\frac{D_{if}^2}{2\sigma_{W,f}^2} \sim \chi^2_m. $$

The factor of two in the denominator is essential: the variance of a difference of two independent observations, each with variance \(\sigma_{W,f}^2\), is \(2\sigma_{W,f}^2\). Using the wrong scaling changes the estimated variance and the reference distribution. The chi-square results also rely on normality and independence across subjects; they do not make a non-normal or dependent design behave as if those assumptions held.

Worked Example: Estimating Reference Variance From Four Replicate Pairs

Suppose, hypothetically, that four subjects each receive reference twice. Their log-scale differences \(D_{iR}=Y_{iR1}-Y_{iR2}\) are \(0.20,-0.10,0.30,-0.20\). Assume independent, normally distributed occasion errors with a common within-subject variance, and allow the difference mean to be unknown.

The mean difference is \(\bar{D}_R=(0.20-0.10+0.30-0.20)/4=0.05\). The squared deviations sum to \((0.20-0.05)^2+(-0.10-0.05)^2+(0.30-0.05)^2+(-0.20-0.05)^2=0.1700\).

Thus \(s_{D,R}^2=0.1700/(4-1)=0.05667\) squared log units, and \(\widehat{\sigma}_{W,R}^2=0.05667/2=0.02833\) squared log units. The estimate is based on three degrees of freedom for the centered differences. It estimates reference within-subject variance under the assumed model; it is not the variance of all reference observations across subjects.

How Design Contrasts Determine What Is Estimable

The same logic extends beyond a single pair. In a crossover model, a contrast is a weighted sum of observations whose coefficients sum to zero. That condition cancels any additive effect common to all observations from a subject. Under independent occasion errors, the variance of a contrast is the sum of each error variance multiplied by the square of its coefficient. This gives a direct way to see which variance components the design can reveal.

$$ C=\sum_j c_jY_{ij}, \qquad \sum_j c_j=0 \quad\Longrightarrow\quad \operatorname{Var}(C)=\sum_j c_j^2\sigma_{W,f_j}^2 $$

The formula assumes the errors at the occasions are independent, with variance determined by the formulation at that occasion. A difference between two replicates of the same formulation has coefficients \(1\) and \(-1\), so its variance is \(2\sigma_{W,f}^2\). A contrast involving different formulations can instead combine their variances. Such a contrast does not, by itself, separate them.

Worked Example: What a Three-Period Partial Replicate Can Estimate

Consider a hypothetical three-period sequence R–T–R. Write its log observations for one subject as \(Y_{R1},Y_T,Y_{R2}\). Assume an additive subject effect, independent occasion errors, and that period effects are either absent or properly accounted for in the contrast.

The reference replicate contrast \(D_R=Y_{R1}-Y_{R2}\) has variance \(\operatorname{Var}(D_R)=\sigma_{W,R}^2+\sigma_{W,R}^2=2\sigma_{W,R}^2\). Across subjects, replicate reference contrasts can therefore estimate \(\sigma_{W,R}^2\). But there is only one test observation per subject, so no within-subject test replicate difference is available to isolate \(\sigma_{W,T}^2\).

A test-versus-reference contrast can be formed as \(C=Y_T-(Y_{R1}+Y_{R2})/2\). Its coefficients sum to zero, and its variance is \(\sigma_{W,T}^2+(1/4+1/4)\sigma_{W,R}^2=\sigma_{W,T}^2+\sigma_{W,R}^2/2\). This contrast mixes the two variances. Knowing its variance alone does not identify each component separately. The design’s replicate pattern—not just the total number of observations—determines which components are estimable.

Worked Example: Estimating Both Formulation Variances in a Fully Replicated Study

Suppose, hypothetically, that five subjects each receive test twice and reference twice. After accounting for the planned sequence and any relevant period effects, their test replicate differences are \(0.10,-0.10,0.20,0.00,-0.20\), and their reference replicate differences are \(-0.20,0.20,0.00,0.20,-0.20\). Assume each set has a common but unknown difference mean, and that differences are independent across subjects with normally distributed occasion errors.

The test differences average zero. Their squared deviations sum to \(0.10\), so \(s_{D,T}^2=0.10/(5-1)=0.02500\), giving \(\widehat{\sigma}_{W,T}^2=0.02500/2=0.01250\) squared log units.

The reference differences also average zero. Their squared deviations sum to \(0.16\), so \(s_{D,R}^2=0.16/4=0.04000\), giving \(\widehat{\sigma}_{W,R}^2=0.04000/2=0.02000\) squared log units. Each estimate uses four degrees of freedom. Separate replicate contrasts support separate estimates; pooling them would impose an additional equal-variance assumption that the design itself does not require.

Model Adjustment, Diagnostics, and Failure Modes

Direct differences are transparent when the two observations in each replicate pair are comparable. In a multi-period study, however, a difference may also reflect a systematic period contrast. If one replicate is typically given later, a raw difference can combine within-subject error with a period effect. A suitable linear model can adjust for period and sequence, and its residual or contrast-based estimates can then target the within-subject component. The model must preserve the replication information: treating all observations as unrelated discards the within-subject structure, while treating every difference as if its mean were known to be zero can misstate uncertainty.

Useful checks include examining replicate differences by formulation, sequence, and period; looking for outlying differences and unequal spread; and confirming that the planned replicate observations are actually present. A systematic nonzero difference may signal an unmodeled period effect or a data issue, rather than a change in random variability. Dependence between occasions also matters: if the two occasion errors have correlation \(\rho_f\), then \(\operatorname{Var}(Y_{if1}-Y_{if2})=2\sigma_{W,f}^2(1-\rho_f)\). Dividing this contrast variance by two estimates \(\sigma_{W,f}^2(1-\rho_f)\), not the marginal variance \(\sigma_{W,f}^2\), unless \(\rho_f=0\) or the model accounts for the dependence.

A direct sample variance of differences is easiest to interpret and calculate when pairs are complete and the design is simple. A model-based contrast approach is more appropriate when period effects, unequal replication, or other planned covariates must be handled. Neither approach repairs a design that contains no information to identify a desired component: for example, an unreplicated formulation’s within-subject variance cannot be recovered from a single observation per subject without additional assumptions or external information.

Common pitfall: A test–reference difference is not a replicate difference for either formulation. Under independent occasion errors, its variance contains contributions from both formulations. Dividing that variance by two and labeling the result “reference within-subject variance” is unjustified unless additional design contrasts or assumptions identify the reference component.

These variance estimates describe variability on the log scale. If a coefficient of variation is useful for interpretation, the usual lognormal conversion is \(\mathrm{CV}_{W,f}=\sqrt{\exp(\sigma_{W,f}^2)-1}\), expressed as a proportion (multiply by 100 for a percentage). This conversion does not change which variance components the design identifies. Variance estimation should therefore be reported with the endpoint, scale, model, replicate contrasts, and assumptions made explicit.

Check Your Understanding

Answer each question using the design and assumptions stated.

  1. With \(m\) replicate differences and an unknown common difference mean, why does the direct variance estimator have \(m-1\), rather than \(m\), degrees of freedom?
  2. A study replicates reference but gives test once per subject. Which within-subject variance can be estimated from direct replicate differences?
  3. Under independent occasion errors, what is the variance of the contrast \(Y_{T1}-Y_{T2}\) when both observations are test?
  4. Why can a test-minus-reference contrast fail to identify either formulation’s variance separately?

Solutions. (1) The sample mean of the differences is estimated from the same \(m\) values, leaving \(m-1\) independent deviations for the sample variance. (2) Reference within-subject variance is identifiable from its replicate contrasts; the single test observation per subject supplies no direct test replicate contrast. (3) The variance is \(\sigma_{W,T}^2+\sigma_{W,T}^2=2\sigma_{W,T}^2\). (4) Its variance generally contains contributions from both formulations, so one combined variance does not uniquely determine two separate components.