Getting started
Your first sample size calculation
A walkthrough for a parallel cluster randomised trial with a continuous outcome, then the same design extended to a stepped wedge. Ten minutes, no installation.
-
Choose a starting shape
The calculator opens on a two-arm parallel design with ten clusters per arm. Presets across the top load the other standard schedules. Pick the one closest to your trial — you will edit it next.
-
Draw the schedule
Click any cell to cycle it through control, intervention, and not enrolled. Right-click a row or column header to insert or delete sequences and periods, or to set an entire sequence or period in one action. The number beside each row label is the number of clusters randomised to that sequence; edit it directly.
For a parallel trial you need one period and two sequences. For a stepped wedge with four sequences you need five periods, with each sequence crossing over one period later than the last.
-
Set the outcome and effect size
Under Analysis Options, choose continuous, binary, or count. The treatment effect field relabels itself accordingly: a mean difference for continuous outcomes, an absolute risk difference for binary, a rate ratio for counts. Binary and count outcomes also need a baseline — the control-arm probability or rate.
A common error is entering a standardised effect size while thinking in raw units. For continuous outcomes the calculator works on the outcome’s own scale, with the residual variance implied by the ICC.
-
Set the correlation
The intracluster correlation is the one parameter people most often guess at. Values between 0.01 and 0.05 are typical for health service outcomes measured on patients within practices or wards; higher values are common for outcomes measured on staff, or for process measures under strong local control.
With more than one period you also choose a correlation structure. Exchangeable assumes correlation between two observations in the same cluster does not depend on how far apart in time they are — usually optimistic for a trial running over years. The alternatives are explained here.
-
Set cluster sizes
Under Sample Size Options, enter the mean number of individuals per cluster-period. If cluster sizes vary substantially, enter a coefficient of variation; the calculator inflates the variance accordingly. If you know the exact size of each cell — which happens when clusters are known in advance — switch to exact mode and right-click cells to set them individually.
-
Choose how you will analyse the trial
Set the estimator to match your analysis plan, not to maximise power. If your statistical analysis plan says a linear mixed model with Kenward–Roger degrees of freedom, choose that. Then change it a few times and watch what happens to power. A design whose power is stable across estimators is robust; one that is only adequately powered under the most optimistic method is not.
-
Read the results, and the warnings
Power, degrees of freedom, standard error, and minimum detectable effect appear in the results table. If a warning panel appears above it, read it before anything else — it means either that your estimator choice is flattering the design, or that the correlation parameters you have specified are hard to realise in the model being fitted.
-
Explore rather than solve
The plot below the results is the most useful part of the tool. Set the x-axis to total clusters and you can read off the number needed for 80% power directly. Set it to ICC and you can see how sensitive that answer is to a parameter you are guessing. Switch to the contour view to see power across cluster count and cluster size at once — which is the real trade-off when recruitment is the binding constraint.
-
Add a comparison
Use Add Design to duplicate what you have, then change one thing: add a baseline period, drop a sequence, halve the cluster size. Both designs appear side by side in the results table and overlaid on the plot. This is usually more informative than any single number.
-
Export
Save the session as JSON so you can return to it. Export the grid as a PNG for the protocol. If the calculation is going into a grant application or a submission, export the verification bundle — it contains every matrix in the computation and an R script that reproduces the standard error independently.
A sample size calculation is a statement of what a trial can detect under assumptions you have chosen, not a prediction. The most valuable output of this tool is usually not the number in the power box but the shape of the curve around it — how quickly power falls away if the ICC is twice what you assumed, or if recruitment reaches 70% of target. Report that sensitivity, and reviewers will trust the headline number more, not less.