Tutorials › Adaptive Clinical Trial Design › Re-Estimation For Repeated-Measures Outcomes

Sample Size Re-Estimation · Tutorial 339 of 799

Re-Estimation For Repeated-Measures Outcomes

Derive the contrast variance from the repeated-measures covariance matrix, then use interim covariance estimates to update a prespecified sample size without replacing the planned treatment effect.

Advanced 12 min read

What You'll Learn

  • Express a repeated-measures treatment contrast as a weighted sum of visit-specific outcomes.
  • Derive its variance from the within-participant covariance matrix.
  • Recalculate a target sample size using an interim covariance estimate and a fixed design effect.
  • Adapt the calculation to multiple visits and unequal allocation.
  • Identify covariance-estimation and design assumptions that can make re-estimation unreliable.

Why Within-Participant Covariance Matters

Repeated-measures trials collect outcomes from each participant at more than one time point. The measurements on one participant are usually related: a participant with a relatively high outcome at one visit may also have a relatively high outcome at another. That dependence affects the precision of a treatment contrast. A sample size calculation that treats visits as independent can therefore misstate the variance and lead to an unsuitable target.

This tutorial considers re-estimation of the sample size for a prespecified linear contrast of visit-specific treatment means. The adaptation uses an interim estimate of the within-participant covariance matrix, while retaining the planned treatment effect, significance level, and power target. The covariance matrix is a nuisance parameter: it determines the contrast variance but is not itself the treatment effect of interest.

Definition: For a participant measured at \(K\) visits, write the outcome vector as \(Y=(Y_1,\ldots,Y_K)^T\), with within-participant covariance matrix \(\Sigma\). A prespecified contrast has weights \(c=(c_1,\ldots,c_K)^T\) and participant-level value \(c^T Y\). Its variance is \(c^T\Sigma c\). For treatment and control, the target contrast in means is \(\theta=c^T(\mu_T-\mu_C)\), where \(\mu_T\) and \(\mu_C\) are the visit-specific mean vectors.

For example, weights \(c=(-1,1)^T\) define change from an initial visit to a later visit. Weights \(c=(-1,0.5,0.5)^T\) define the average of two later measurements minus the initial measurement. In each case, the same weights must be applied to the treatment and control mean vectors. The planned effect \(\theta\) is the treatment-minus-control difference in that particular contrast, measured in the outcome’s units.

Assumptions and the Sample Size Formula

The basic calculation uses a common within-participant covariance matrix in the two randomized groups, independent participants across groups, and a complete repeated-measures vector for each participant. It also assumes that the planned contrast and its effect \(\theta\) are fixed in advance. For a normal-approximation calculation, the contrast estimator is treated as approximately normally distributed; the calculation is most suitable when the planned sample is large enough for that approximation to be reasonable.

With \(n_T\) participants assigned to treatment and \(n_C\) assigned to control, the estimated treatment difference in the contrast is \(c^T\bar{Y}_T-c^T\bar{Y}_C\). Under the assumptions above, its variance is \(c^T\Sigma c(1/n_T+1/n_C)\). For equal allocation and total sample size \(N\), this becomes \(4c^T\Sigma c/N\).

$$ \operatorname{Var}\{c^T\bar{Y}_T-c^T\bar{Y}_C\} = c^T\Sigma c\left(\frac{1}{n_T}+\frac{1}{n_C}\right) $$

For a two-sided test at significance level \(\alpha\), a normal-approximation sample size targeting power \(1-\beta\) at effect \(\theta\) is obtained by requiring the signal-to-standard-error ratio to reach \(z_{1-\alpha/2}+z_{1-\beta}\). Under equal allocation this gives the following total sample size.

$$ N = \frac{4(c^T\Sigma c)\left(z_{1-\alpha/2}+z_{1-\beta}\right)^2}{\theta^2} $$

This is a planning approximation, not a guarantee of exact power. In practice, the result is rounded up to a feasible allocation, often an even total. If a protocol specifies a different final test or small-sample procedure, its corresponding sample size calculation must be used instead of assuming that this approximation is exact.

Deriving the Contrast Variance

The covariance calculation follows directly from the variance of a linear combination. Write the contrast as \(c^TY=\sum_{j=1}^{K}c_jY_j\). The variance of a weighted sum includes both the individual visit variances and the covariances between visits:

$$ \operatorname{Var}(c^TY) = \sum_{j=1}^{K}c_j^2\operatorname{Var}(Y_j) + 2\sum_{j<k}c_jc_k\operatorname{Cov}(Y_j,Y_k) = c^T\Sigma c $$

For independent participants, the variance of a group mean vector is \(\Sigma/n\). Applying the contrast weights to that mean vector gives \(\operatorname{Var}(c^T\bar{Y})=c^T(\Sigma/n)c=(c^T\Sigma c)/n\). The treatment and control group means are independent, so the variance of their difference is the sum of those two variances. This yields the formula above. The covariance terms can increase or decrease the contrast variance depending on the signs of the weights and the correlations between visits.

Worked Example: Re-Estimating a Change-Contrast Sample Size

Suppose the primary endpoint is the treatment-minus-control difference in change from baseline to one follow-up visit. The contrast weights are \(c=(-1,1)^T\). The planned effect is 5 mmHg, with two-sided \(\alpha=0.05\) and power \(0.90\). At design, the assumed covariance matrix, in squared mmHg, is

$$ \Sigma= \begin{pmatrix} 100 & 60\\ 60 & 100 \end{pmatrix}. $$

The variance of an individual participant’s change is

$$ c^T\Sigma c = (-1,1) \begin{pmatrix} 100 & 60\\ 60 & 100 \end{pmatrix} \begin{pmatrix}-1\\1\end{pmatrix} = 100+100-2(60)=80\ \text{mmHg}^2. $$

Using \(z_{0.975}=1.960\) and \(z_{0.90}=1.282\), the planned total sample size is

$$ N = \frac{4(80)(1.960+1.282)^2}{5^2} = \frac{320(10.51)}{25} \approx 134.5. $$

Rounding up to an even total gives 136 participants, 68 per group. Now suppose an interim estimate, based on within-group residuals, has the same visit variances but a covariance of 30 mmHg\(^2\). The updated change variance is \(100+100-2(30)=140\) mmHg\(^2\), so the revised calculation is

$$ N_{\text{updated}} = \frac{4(140)(1.960+1.282)^2}{5^2} = \frac{560(10.51)}{25} \approx 235.4. $$

Rounding up to an even total gives 236 participants. The smaller estimated correlation makes the variance of a change score larger, so more participants are required for the same planned effect and power. These calculations assume that the interim estimate is relevant to the final population and that the planned effect remains 5 mmHg; neither assumption is established merely by observing the interim covariance.

Updating the Covariance Estimate

At the interim analysis, estimate the covariance matrix for the repeated outcomes using the prespecified estimation procedure, then calculate \(\widehat{v}=c^T\widehat{\Sigma}c\). Replace \(c^T\Sigma c\) by \(\widehat{v}\) in the sample size formula. This is the central operation: re-estimation translates the current covariance estimate into the variance of the particular contrast that will be tested.

A covariance estimate must correspond to the planned analysis. For example, if the analysis defines the endpoint as a weighted contrast across all visits, the re-estimation should use the covariance of those same visits and apply those same weights. An estimate based on a different visit schedule or a different contrast does not directly estimate the variance needed for the planned test.

In an internal pilot, the within-group covariance should reflect variation around the group-specific visit means rather than variation around a single pooled mean that also contains a treatment difference. A prespecified data-access procedure should determine who can estimate and use the nuisance parameter. Re-estimation based on interim treatment effects is not the procedure described here: the planned effect \(\theta\) remains fixed, rather than being replaced by a noisy observed effect.

Worked Example: A Three-Visit Contrast

Suppose the primary contrast compares the average outcome at two post-baseline visits with the baseline outcome. Its weights are \(c=(-1,0.5,0.5)^T\). At interim, the estimated covariance matrix is

$$ \widehat{\Sigma} = 100 \begin{pmatrix} 1 & 0.6 & 0.4\\ 0.6 & 1 & 0.5\\ 0.4 & 0.5 & 1 \end{pmatrix}. $$

The diagonal entries give visit variances of 100 outcome-units squared. The off-diagonal entries give covariances of 60, 40, and 50 outcome-units squared. The estimated contrast variance is

$$ \begin{aligned} \widehat{v} &=100\left[(-1)^2+(0.5)^2+(0.5)^2 +2(-1)(0.5)(0.6) +2(-1)(0.5)(0.4) +2(0.5)(0.5)(0.5)\right]\\ &=100[1.5-0.6-0.4+0.25]=75\ \text{outcome-units}^2. \end{aligned} $$

Suppose the planned treatment effect for this contrast is 4 outcome units, with two-sided \(\alpha=0.05\) and power \(0.90\). Then

$$ N = \frac{4(75)(1.960+1.282)^2}{4^2} = \frac{300(10.51)}{16} \approx 197.1. $$

The equal-allocation target is therefore 198 participants, 99 per group. The calculation uses the full covariance matrix: the diagonal contributions alone would give a contrast variance of 150, twice the correct value here. Positive correlation between baseline and follow-up outcomes reduces the variance of this contrast because their weights have opposite signs.

Unequal Allocation and Operational Rules

If the allocation ratio is not one-to-one, use the group-specific variance expression rather than the equal-allocation formula. For a fixed total \(N\), let \(n_T=qN\) and \(n_C=(1-q)N\), where \(q\) is the treatment allocation fraction. Then the variance is \((c^T\Sigma c)\{1/(qN)+1/[(1-q)N]\}\). This keeps the within-participant covariance calculation unchanged while accounting for the allocation design.

Worked Example: Updating Under Unequal Allocation

Suppose the interim covariance estimate for a two-visit change contrast gives \(\widehat{v}=116\) outcome-units squared. The planned effect is 6 outcome units, with two-sided \(\alpha=0.05\), power \(0.90\), and treatment-to-control allocation ratio \(3:2\). Thus \(q=0.60\), and the variance of the estimated treatment difference is

$$ 116\left(\frac{1}{0.60N}+\frac{1}{0.40N}\right) = \frac{116(4.1667)}{N}. $$

The resulting total sample size is

$$ N = \frac{116(1/0.60+1/0.40)(1.960+1.282)^2}{6^2} = \frac{483.3(10.51)}{36} \approx 141.1. $$

To preserve the 3:2 allocation, round up to the next total divisible by five: \(N=145\), with 87 treatment and 58 control participants. This rounding gives at least the target sample size under the stated approximation. It does not account for loss of usable outcome vectors; any such allowance must be justified and prespecified separately.

A protocol should also specify operational limits, such as a minimum and maximum sample size, and the exact rounding rule. Apply those rules after the covariance-based calculation. A floor or cap changes the implemented target; it does not change the variance formula or make an inadequate target adequate. The earlier material on sample size floors and caps and on fixed final tests is relevant when specifying those broader design safeguards.

Diagnostics, Limitations, and a Common Pitfall

Before using an interim covariance estimate, check that its visit ordering and units match the analysis plan, that the estimated variances and correlations are plausible, and that the resulting matrix is positive semidefinite. A valid covariance matrix cannot imply a negative variance for any linear contrast; in particular, \(c^T\widehat{\Sigma}c\) must not be negative. If it is, investigate the data handling or estimation procedure rather than inserting the value into the sample size formula.

An interim estimate may also be unstable when few participants have complete repeated measurements. A change in covariance across time, treatment groups, or participant subgroups can undermine the common-covariance assumption. Further, a covariance estimate from early enrollees may not represent later enrollees if the trial population or measurement process changes. The plug-in calculation treats \(\widehat{\Sigma}\) as if it were the true covariance; it does not automatically account for uncertainty in that estimate. Prespecified floors, caps, and sensitivity analyses can help control operational consequences, but they do not remove the underlying uncertainty.

  • Common mistake: “The follow-up and baseline outcomes are positively correlated, so the variance of their difference must be larger.” This ignores the contrast weights. For \(c=(-1,1)\), the covariance enters as \(-2\operatorname{Cov}(Y_1,Y_2)\), so positive covariance reduces the variance of change.
  • Correction: Calculate \(c^T\widehat{\Sigma}c\) using all diagonal and off-diagonal terms and the actual prespecified weights. Do not infer the contrast variance from a correlation alone.
  • Common mistake: Replacing the planned effect with the interim observed treatment effect in the sample size formula. The observed effect can be noisy and can make the new target respond to an unusually large or small interim result.
  • Correction: For covariance-based nuisance re-estimation, retain the prespecified \(\theta\) and update the covariance term. The interim effect is not a substitute for the design effect.

Finally, changing the sample size based on interim data does not by itself establish that the final test retains its intended type I error. The re-estimation rule and final testing procedure must be specified together and justified for the design. The covariance-only calculation describes how to update the target under its assumptions; it is not a general proof of inferential validity for every adaptive implementation.

Key takeaway: For a prespecified repeated-measures contrast, the relevant nuisance parameter is \(c^T\Sigma c\), not a single visit variance or correlation considered in isolation. Estimate the covariance using a procedure aligned with the planned analysis, keep the design effect fixed, and apply the prespecified sample size and testing rules.

Check Your Understanding

Try each problem, then compare your reasoning with the solutions below.

  1. For a two-visit change contrast with visit variances 64 and 100 and covariance 24, calculate the variance of an individual participant’s change.
  2. In a three-visit contrast with weights \(c=(-1,0.5,0.5)^T\), explain why omitting the covariance terms can give a wrong sample size.
  3. A trial uses a prespecified effect of 3 units. Its interim covariance estimate changes, but the planned effect does not. Which term in the equal-allocation sample size formula is updated?
  4. What does a negative value of \(c^T\widehat{\Sigma}c\) indicate, and what should the design team do?

Solutions. (1) The change variance is \(64+100-2(24)=116\) outcome-units squared. (2) The covariance terms contribute \(2c_jc_k\operatorname{Cov}(Y_j,Y_k)\) for each pair of visits. Their signs depend on the contrast weights, so leaving them out changes the contrast variance and therefore the required sample size. (3) Update \(c^T\Sigma c\) using the interim covariance estimate; retain \(\theta=3\) in the denominator. (4) A valid covariance matrix cannot produce a negative variance for a contrast. Check the covariance estimation and data-handling procedure, resolve the problem, and do not use the negative value for re-estimation.

Clinical Biostats