Tutorials › Model-Informed Drug Development (MIDD) › Worked Sample-Size Planning for a Longitudinal Endpoint

Model-Based Endpoint and Sample Size Planning · Tutorial 325 of 596

Worked Sample-Size Planning for a Longitudinal Endpoint

Work through a longitudinal treatment-contrast sample-size calculation, from covariance assumptions to a defensible enrollment target.

Advanced 11 min read

What You'll Learn

  • Define a longitudinal treatment contrast that matches the planned estimand.
  • Derive the variance of a difference in mean changes from baseline and endpoint covariance.
  • Calculate balanced-arm sample size for a two-sided power target.
  • Inflate the completer target for expected loss of endpoint data.
  • Recognize when a simple dropout adjustment or covariance assumption is inadequate.

From the Estimand to the Enrollment Target

A sample-size calculation for a longitudinal endpoint is only as relevant as the treatment effect it is designed to detect. The endpoint, assessment time, treatment contrast, covariance assumptions, and handling of missing outcomes must describe one coherent plan. This tutorial develops that plan for a continuous outcome measured at baseline and at a primary follow-up visit.

Suppose the primary question is whether the mean change from baseline to week 24 differs between an active treatment and control. The treatment contrast is active minus control, so a negative value would favor active treatment if lower scores are better. The numerical example uses arbitrary outcome points and hypothetical inputs; it does not represent a real study.

Definition: Let \(Y_{i0}\) and \(Y_{i24}\) be participant \(i\)'s outcome at baseline and week 24. Define the participant's change as \(D_i=Y_{i24}-Y_{i0}\). The week-24 treatment contrast is \(\delta=E(D_i\mid A_i=1)-E(D_i\mid A_i=0)\), where \(A_i=1\) denotes active treatment and \(A_i=0\) denotes control. The planning estimand must specify the target population, treatment conditions, endpoint, assessment time, summary measure, and how relevant intercurrent events are handled.

The calculation below assumes the week-24 change is the primary response. A mixed model represents repeated outcomes jointly, but the worked calculation uses the contrast in arm-specific mean changes. If an analysis instead estimates the contrast by using all follow-up visits, baseline covariate adjustment, or a different missing-data strategy, its treatment-contrast variance may differ and should be calculated for that planned analysis.

Model and Covariance Assumptions

For each participant, write the repeated outcome vector as \(\mathbf{Y}_i=(Y_{i0},Y_{i24})^\mathsf{T}\). A linear mixed-effects model specifies the mean at each visit using treatment, visit, and their interaction, and describes the within-participant dependence through a covariance matrix. For this two-visit planning calculation, assume a common covariance matrix in both treatment arms:

$$ \mathbf{Y}_i \sim N(\boldsymbol{\mu}_{A_i},\boldsymbol{\Sigma}), \qquad \boldsymbol{\Sigma}= \begin{pmatrix} \sigma_0^2 & \sigma_{0,24}\\ \sigma_{0,24} & \sigma_{24}^2 \end{pmatrix}. $$

Here, \(\sigma_0^2\) and \(\sigma_{24}^2\) are the baseline and week-24 variances, and \(\sigma_{0,24}\) is their covariance. The treatment contrast in the group-by-visit pattern is the difference between mean changes. For the simple balanced calculation, assume independent participants, no clustering, equal allocation, the same change-score variance in both arms, and normally distributed changes (or a sample size large enough for the normal approximation to be adequate). The calculation also treats the variance as known at its planning value.

These assumptions are planning choices, not facts guaranteed by randomization. In particular, the correlation between repeated measurements affects the variance of change, while the treatment effect \(\delta\) and the change-score variability must come from defensible external or pilot evidence. The introductory material on repeated-measure correlation and effective sample size explains why repeated observations cannot be counted as independent participants.

Deriving the Treatment-Contrast Variance

The change for one participant is \(D_i=Y_{i24}-Y_{i0}\). Applying the variance rule for a difference gives:

$$ \sigma_D^2 =\operatorname{Var}(Y_{i24}-Y_{i0}) =\sigma_{24}^2+\sigma_0^2-2\sigma_{0,24} =\sigma_{24}^2+\sigma_0^2-2\rho_{0,24}\sigma_0\sigma_{24}. $$

The factor of two is essential: the covariance contributes twice when the variance of a difference is expanded. Let \(\bar{D}_T\) and \(\bar{D}_C\) be the sample mean changes in the active and control arms, with \(n_T\) and \(n_C\) participants, respectively. Independence between participants and between randomized arms implies:

$$ \operatorname{Var}(\bar{D}_T-\bar{D}_C) =\frac{\sigma_D^2}{n_T}+\frac{\sigma_D^2}{n_C} =\sigma_D^2\left(\frac{1}{n_T}+\frac{1}{n_C}\right). $$

With equal allocation, \(n_T=n_C=n\), the standard error is \(SE=\sqrt{2\sigma_D^2/n}\). For a two-sided test of \(H_0:\delta=0\) at significance level \(\alpha\), the normal-approximation sample size per arm for power \(1-\beta\) is:

$$ n= \frac{2\sigma_D^2\left(z_{1-\alpha/2}+z_{1-\beta}\right)^2}{\delta^2}. $$

The expression follows by requiring the expected standardized treatment contrast under the planned alternative to exceed the null rejection boundary by the desired power quantile. In other words, the noncentrality \(|\delta|/SE\) is set to \(z_{1-\alpha/2}+z_{1-\beta}\). Squaring and substituting \(SE^2=2\sigma_D^2/n\) gives the formula above. The \(z\) values are standard normal quantiles. For small samples, or when the variance is estimated rather than known, a noncentral-\(t\) calculation is preferable; it can require iterative evaluation because the degrees of freedom depend on sample size.

Worked Example: Obtaining the Change-Score Variance

Suppose hypothetical baseline and week-24 standard deviations are 12 and 14 points, and their within-person correlation is 0.50. Calculate the variance and standard deviation of change.

First, the covariance is \(\sigma_{0,24}=\rho_{0,24}\sigma_0\sigma_{24}=0.50(12)(14)=84\) points squared. Therefore:

$$ \sigma_D^2=12^2+14^2-2(84)=144+196-168=172\ \text{points}^2. $$

The change-score standard deviation is \(\sigma_D=\sqrt{172}=13.11\) points. The correlation is positive, so baseline and week-24 values partly move together; this reduces the variability of their difference relative to treating the two measurements as independent. A valid covariance matrix also requires \(|\rho_{0,24}|\leq 1\) and positive variances.

Worked Sample-Size Plan

A defensible plan proceeds from the estimand to the variance, then to the test and its power, and finally to enrollment. Each input should be stated in context, including units. The sample size is not a stand-alone number: it is conditional on these assumptions.

1
Specify the estimand and contrast.
State the endpoint, visit, target population, treatment comparison, and intercurrent-event strategy. Define whether a positive or negative contrast favors treatment.
2
Specify the repeated-measure covariance.
Use baseline and endpoint variances and their covariance or correlation to derive the variance of the planned contrast.
3
Set the test and power inputs.
Choose the two-sided or one-sided test, \(\alpha\), target power, clinically relevant effect size, and allocation ratio.
4
Calculate completers and enrollment.
Round the completer requirement up to a whole participant per arm, then adjust for expected loss of endpoint data under the stated assumptions.

Worked Example: Planning a Two-Arm Week-24 Contrast

Consider a hypothetical trial with a two-sided \(\alpha=0.05\), 90% power, equal allocation, and a target treatment difference of 6 outcome points in mean change. Use the change-score variance of \(172\ \text{points}^2\) calculated above. Assume independent participants and a common change-score variance across arms.

For this plan, \(z_{1-\alpha/2}=1.96\) and \(z_{1-\beta}=1.2816\). The normal-approximation sample size per arm is:

$$ n= \frac{2(172)(1.96+1.2816)^2}{6^2} = \frac{2(172)(10.508)}{36} = \frac{3614.752}{36} =100.41. $$

Because participants cannot be enrolled fractionally and power must not fall below the target through rounding, the requirement is 101 participants with usable week-24 endpoint data per arm. This is a completer target, not yet the enrollment target.

Suppose 15% of enrolled participants are expected to lack usable week-24 data. If that proportion applies similarly in both arms and the planned estimator remains valid under the missing-data mechanism, inflate each arm separately:

$$ n_{\text{enroll, arm}} = \left\lceil\frac{101}{1-0.15}\right\rceil = \left\lceil118.82\right\rceil =119. $$

The justified planning target is therefore 119 per arm, or 238 participants in total. This adjustment compensates for the expected loss of endpoint information; it does not repair bias if missingness is related to unobserved outcomes in a way the analysis cannot handle.

Dropout, Diagnostics, and Alternatives

The simple inflation rule is \(n_{\text{enroll}}=\lceil n_{\text{complete}}/(1-r)\rceil\) per arm, where \(r\) is the expected proportion without usable primary endpoint data. It assumes the loss rate is reasonably predictable and that the analysis can still estimate the intended contrast without material bias. It is an approximation when participants contribute partial longitudinal data to a mixed model: such participants may provide information even without a week-24 observation, so dividing by \(1-r\) may overstate or understate the required enrollment.

Before accepting a plan, check that the covariance estimates are plausible for the chosen scale and visit schedule, that the derived variance is nonnegative, and that the assumed treatment effect is clinically meaningful rather than merely statistically detectable. Check the exact-sidedness of the test and the quantiles used. For an implemented design, compare the assumed and observed visit patterns, arm-specific endpoint availability, and fitted covariance behavior; large differences can make the original power calculation a poor description of the study.

A direct change-score calculation is transparent and is appropriate when the planned primary estimator is the difference in mean changes. An ANCOVA that adjusts the endpoint for baseline can have a different variance and may be more efficient under its model assumptions. A repeated-measures mixed model can use multiple post-baseline visits and incomplete outcome histories, but its contrast variance depends on the full mean and covariance model and the missing-data assumptions. Fisher information calculations or simulation are useful alternatives when the design has unequal visits, unequal allocation, more complex covariance, or a nonlinear model; they should target the same estimand and analysis as the proposed study.

A common mistake is to treat the baseline and endpoint measurements as independent, or to use the endpoint standard deviation alone as the standard deviation of change. The correction is to calculate \(\sigma_D^2=\sigma_{24}^2+\sigma_0^2-2\sigma_{0,24}\) using the planned within-person covariance. Another mistake is to inflate for dropout and assume this guarantees valid power. Inflation addresses expected sample loss only; it cannot by itself correct an inappropriate estimand, misspecified covariance, or informative missingness.

Worked Example: A Lower Correlation Changes the Target

Suppose the same hypothetical marginal standard deviations, 12 and 14 points, apply, but the planning correlation is 0.30 rather than 0.50. The covariance is \(0.30(12)(14)=50.4\ \text{points}^2\), so:

$$ \sigma_D^2=12^2+14^2-2(50.4)=144+196-100.8=239.2\ \text{points}^2. $$

Keeping the 6-point effect, two-sided \(\alpha=0.05\), and 90% power:

$$ n= \frac{2(239.2)(10.508)}{36} = \frac{5027.0272}{36} =139.64. $$

Round up to 140 completers per arm. With 15% expected endpoint loss, the enrollment target becomes \(\lceil140/0.85\rceil=165\) per arm, or 330 total. The result illustrates why the covariance assumption must be justified: a lower correlation increases the variance of change and raises the enrollment target.

Check Your Understanding

Try each question, then compare your reasoning with the brief solutions.

  1. Baseline and endpoint standard deviations are 10 and 12 points, with correlation 0.40. What is the variance of change?
  2. Why does the variance of change contain minus twice the covariance rather than minus the covariance once?
  3. For an equal-allocation two-arm study, how does the variance of the estimated treatment contrast change if the per-arm completer sample size is doubled?
  4. A plan requires 80 endpoint completers per arm and expects 20% without usable endpoint data. What is the enrollment target per arm?
  5. Why does dropout inflation not guarantee an unbiased estimate of the intended treatment contrast?

Solutions: (1) The covariance is \(0.40(10)(12)=48\ \text{points}^2\), so \(\sigma_D^2=10^2+12^2-2(48)=100+144-96=148\ \text{points}^2\). (2) Expanding \(\operatorname{Var}(Y_{24}-Y_0)\) gives the covariance term from each of the two cross-products, hence \(-2\operatorname{Cov}(Y_{24},Y_0)\). (3) Since the contrast variance is \(2\sigma_D^2/n\), doubling \(n\) halves that variance, assuming the other inputs remain unchanged. (4) \(\lceil80/(1-0.20)\rceil=\lceil100\rceil=100\) participants per arm. (5) Inflation increases enrollment to offset expected loss; if endpoint missingness depends on unobserved outcomes or otherwise violates the analysis assumptions, the estimated contrast may still be biased.