Power for a stepped wedge trial
For a cross-sectional stepped wedge, Mallard computes power at fixed clusters and periods; it does not return a headline recruitment total.
Why this level?
not one of the five research areas this hierarchy covers. NHMRC 2009 sourceA power calculation does not establish randomization or remove time confounding. The paired design article explains the rollout; the formula only assesses power under its stated design and covariance assumptions.
Fit
When to use it, and when not to
Use it when
- Clusters cross once from control to intervention over a complete rollout with one baseline period.
- Each period samples new people, and a common treatment effect is plausible after allowing for calendar time.
Not when
- The same people are measured each period, sizes vary materially or the rollout has gaps. Use a design-specific calculation or simulation. Read: Simulation-based power and sample-size planning
- The rollout order is operational rather than randomized. Describe a nonrandomized design and assess its assumptions. Read: Interrupted time series
Before you start
What you need
- Clusters and periodsUse at least three periods and at least one cluster per step. The engine spreads switches evenly, assigning remainders to early steps.
- People in each cluster-periodSupply the common number sampled per cluster in each period. It is not the total trial size.
- Within-period correlation and cluster autocorrelationThe intraclass correlation, called ICC, describes similarity within a cluster-period. Cluster autocorrelation, called CAC, scales that similarity between periods.
- A binary risk change or continuous mean differenceoutcomeTypeclusteredFor binary outcomes give baseline and target risks. For continuous outcomes give the standard deviation and target mean difference.
- Two-sided alpha and target powerAlpha sets the cutoff. Target power guides the search for a larger cluster-period size at the fixed clusters and periods.
- Different people are sampled in each period, with equal cluster-period sizes.How to check: Confirm the sampling design. Repeated measurements on the same people need an additional correlation model.
- The chosen correlations describe outcomes within clusters over time.How to check: CAC defaults to one, giving the Hussey and Hughes model. Lower CAC adds cluster-period variation; assess plausible values.
- The analysis includes fixed period effects and a constant treatment effect.How to check: Changing effects, delayed effects and incomplete schedules need a different power assessment.
- The normal reference approximation is adequate.How to check: With few clusters, a small-sample analysis can have less power. Validate the proposed analysis rather than treating the approximation as guaranteed.
Plain language
How it works
The schedule starts with all clusters under control. Groups then switch at each step until all receive treatment. The engine uses cluster-period means and removes fixed period effects from the information about treatment.
Hussey and Hughes give the exchangeable model when CAC is one. Mallard also allows lower CAC with a nested exchangeable covariance. Binary variance uses the average baseline and target risk; continuous variance uses the squared standard deviation. Power uses a normal approximation for the absolute effect divided by its standard error, less the two-sided critical value.
Clusters and periods stay fixed. The search increases cluster-period size toward the target, up to one million. It does not search smaller sizes when the supplied design already meets the target. Some targets remain unreachable.
Worked example
A worked example
- Setting
- A trial fixes 8 wards and 5 periods, with 30 new patients per ward-period.
- Question
- Can it detect a risk change from 20 in 100 to 15 in 100?
- Approach
- Assume ICC 0.05, CAC 1, two-sided alpha 0.05 and target power 80 percent. Two wards switch at each of four steps.
- Result
- The target risk changes from 20 to 15 in 100, a change of -5 percentage points. Approximate power is 26.37 percent. The size search gives 142 per ward-period.
- What it means
- That larger size reaches the assumed target with the same wards and periods. It is not a headline sample size or a minimum across schedules.
In practice
Recent studies PubMed search · not vetted
Watch out
Common mistakes
The one to remember
This closed form assumes cross-sectional sampling, equal cluster-period sizes and a constant treatment effect. Normal-reference power can be optimistic with few clusters; no headline sample size is returned.
- Using an independent two-group formula for a ward rollout.Instead: Keep the cluster and time structure in the variance calculation. A patient-count floor cannot replace it.
- Assuming the result covers a cohort of repeatedly measured patients.Instead: Mallard assumes cross-sectional sampling. Add the participant correlation to a study-specific calculation for a cohort.
- Calling the size search a minimum trial size.Instead: Clusters and periods stay fixed. The search only increases the supplied cluster-period size; a target may remain unreachable.
Inside Mallard
How Mallard uses this
Mallard uses closed-form cluster-period variance for supported cross-sectional stepped wedges. It returns power and a conditional size search, without a headline sample size.
design.power_stepped_wedge, the id a plan cue records.Related Learn pages
Related designs and methods
Evidence
Sources & further reading
- Design and analysis of stepped wedge cluster randomized trials (opens in a new tab) · Contemp Clin Trials · doi 10.1016/j.cct.2006.05.007
- Sample size calculation for stepped wedge and other longitudinal cluster randomised trials (opens in a new tab) · Stat Med · doi 10.1002/sim.7028