Designs
Stepped wedge sample size calculation
In a stepped wedge cluster randomised trial every cluster eventually receives the intervention, but the order in which they cross over is randomised. It is the design of choice when an intervention is being rolled out anyway and withholding it permanently is not acceptable.
The model
The standard analysis model, following Hussey and Hughes (2007), is a linear mixed model with fixed effects for time and a random intercept for cluster:
$$Y_{ijt} = \mu + \beta_t + X_{jt}\,\theta + \alpha_j + e_{ijt}$$
where \(Y_{ijt}\) is the outcome for individual \(i\) in cluster \(j\) at period \(t\), \(\beta_t\) are period effects, \(X_{jt}\) is the treatment indicator, \(\theta\) is the treatment effect, \(\alpha_j \sim N(0,\tau^2)\) is the cluster random effect and \(e_{ijt} \sim N(0,\sigma^2)\) is residual error. The intracluster correlation is
$$\rho = \frac{\tau^2}{\tau^2 + \sigma^2}$$
The fixed period effects are essential. Because clusters cross over at different times, treatment status is confounded with time; a model without period effects will attribute any secular trend to the intervention. This also means the design carries no information about the treatment effect from between-cluster comparisons alone.
What you need to specify
| Parameter | Meaning | Typical values |
|---|---|---|
| Sequences | Number of randomisation groups, each crossing over at a different period | 4–12 |
| Periods | Number of measurement periods, usually sequences + 1 | 5–13 |
| Clusters per sequence | Clusters randomised to each crossover time | 1–10 |
| Cluster-period size | Individuals measured per cluster per period | 10–200 |
| ICC | Within-cluster correlation \(\rho\) | 0.01–0.10 |
| CAC | Cluster autocorrelation, if using nested exchangeable | 0.6–1.0 |
Why stepped wedges are more efficient than they look
A stepped wedge gets information from two sources: vertical comparisons between clusters within the same period, and horizontal comparisons within a cluster before and after crossover. The horizontal comparison is unavailable in a parallel trial and is what makes the stepped wedge competitive despite the confounding with time.
How much the horizontal comparison is worth depends entirely on the correlation structure. Under exchangeable correlation, within-cluster comparisons are highly precise because the cluster effect cancels, and the stepped wedge can need far fewer clusters than a parallel trial. Under a decaying correlation, observations separated by several periods are much less correlated, the cluster effect no longer cancels cleanly, and the advantage shrinks — sometimes substantially.
Assuming exchangeable correlation over a trial lasting two or three years asserts that observations twelve periods apart are as correlated as observations in adjacent periods. For most health service outcomes this is implausible. If you have any basis for it, specify a cluster autocorrelation below 1 or an explicit decay, and check how much power you lose. More on choosing a structure →
Variants the calculator supports
Implementation periods
Real rollouts have transition time. Marking the crossover period as not enrolled removes those cluster-periods from the analysis, which is usually more honest than treating a half-implemented intervention as full strength.
Incomplete and staircase designs
If measurement is expensive, you do not need every cluster measured in every period. The staircase design measures each cluster only in the periods immediately before and after its crossover, discarding cluster-periods that contribute little. It costs remarkably little power relative to the full design while cutting data collection dramatically — turn on cell weights in the calculator to see why.
Common pitfalls
- Ignoring the number of clusters. Power in a stepped wedge is driven far more by the number of clusters than by the number of individuals per cluster. Doubling cluster-period size when the ICC is 0.05 and there are 60 people per period buys almost nothing; adding four clusters may buy a great deal.
- Small-cluster asymptotics. With fewer than about 20 clusters, a model-based z-test overstates power appreciably. Use Kenward–Roger or Satterthwaite degrees of freedom and report that you have done so.
- Assuming a constant treatment effect. If the intervention effect grows over time after implementation, a model assuming an immediate constant effect is misspecified, and the estimated effect is a weighted average that depends on the design. Consider whether an exposure-time model is more appropriate.
- Unequal sequence sizes chosen arbitrarily. Clusters are not equally valuable in every sequence. Turn on row weights to see the optimal distribution before fixing your randomisation.
Working through an example
Suppose 24 general practices will adopt a new referral pathway over two years, in six sequences of four practices, with seven two-monthly periods. The outcome is continuous, with an assumed ICC of 0.03 and roughly 40 eligible patients per practice per period. You expect a difference of 0.25 standard deviations.
To evaluate this: load the stepped wedge preset, set six sequences and seven periods, set four clusters per sequence, mean size 40, ICC 0.03, treatment effect 0.25 with the outcome standardised. Then set the estimator to Kenward–Roger, and plot power against total clusters to see how much slack you have if two practices withdraw.
Open the calculator and try it →
References
- Hussey MA, Hughes JP (2007). Design and analysis of stepped wedge cluster randomized trials. Contemporary Clinical Trials 28(2), 182–191.
- Hooper R, Teerenstra S, de Hoop E, Eldridge S (2016). Sample size calculation for stepped wedge and other longitudinal cluster randomised trials. Statistics in Medicine 35(26), 4718–4728.
- Kasza J, Hemming K, Hooper R, Matthews JNS, Forbes AB (2019). Impact of non-uniform correlation structure on sample size and power in multiple-period cluster randomised trials. Statistical Methods in Medical Research 28(3), 703–716.
- Hemming K, Taljaard M (2020). Reflection on modern methods: when is a stepped-wedge design a good choice? International Journal of Epidemiology 49(3), 1043–1052.