Ask Mallard
Study design

Power for a stepped wedge trial

6 min read

For a cross-sectional stepped wedge, Mallard computes power at fixed clusters and periods; it does not return a headline recruitment total.

NHMRC EVIDENCE LEVEL · 2009Outside the NHMRC hierarchy
Why this level?not one of the five research areas this hierarchy covers. NHMRC 2009 source

A 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

Before you start

What you need

Decide these first
  1. Clusters and periodsUse at least three periods and at least one cluster per step. The engine spreads switches evenly, assigning remainders to early steps.
  2. People in each cluster-periodSupply the common number sampled per cluster in each period. It is not the total trial size.
  3. 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.
  4. 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.
  5. 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.
It rests on these
  1. 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.
  2. 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.
  3. 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.
  4. 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.

The variance calculation

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.

What the size search means

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.

The complete rollout
A stepped wedge as a grid of clusters by calendar period. Every cluster starts in the control condition. In a randomized order, one cluster crosses to the intervention at each step, and none crosses back, so by the last period every cluster is exposed and later periods contain more exposed clusters.Stepped wedge: every cluster starts in control and crosses once, in a randomized orderCalendar time, in periodsFirst periodLast periodCluster ACluster BCluster CCluster DCluster EControl conditionInterventionThe order of crossing is randomized; an order set by an operational schedule is not. Because exposurerises with calendar time, any secular trend must be modeled rather than assumed away.
Conceptual diagram. It shows the structure of the idea, not data from any study.

Worked example

A worked example

Invented for illustration
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

Searching PubMed…

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.

No Mallard code example points to this page.
Atlas node design.power_stepped_wedge, the id a plan cue records.

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. 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
  2. Sample size calculation for stepped wedge and other longitudinal cluster randomised trials (opens in a new tab) · Stat Med · doi 10.1002/sim.7028
Prepared with AI assistance. PubMed source records were checked for title, authors, year and DOI on 2026-11-07. The sources explain the methods; engine tests verify the separate Mallard implementation claims. No independent professional approval is claimed. Hussey and Hughes support CAC equal to one; Hooper and colleagues cover longitudinal correlation structures. Follow the paired design article's stepped-wedge CONSORT guidance for study reporting; it does not validate a power calculation.
Last source review: 2026-11-07
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.