What it is
In a cluster-randomized trial (CRT), treatment is assigned at the group level — villages, schools, health facilities, market areas — rather than to individual respondents. All individuals within an assigned cluster receive the same treatment status. CRTs are used when: individual-level randomisation would create contamination (a treated individual influences control neighbours); the intervention is delivered at the group level (a training for school teachers affects all students); or administrative or logistical constraints prevent individual-level assignment.
The defining statistical feature of a CRT is that outcomes within the same cluster are correlated — the intraclass correlation coefficient (ICC) is non-zero. This reduces the effective sample size below the total number of individuals, because observations within a cluster provide less independent information. The sample size required for equivalent power in a CRT is larger than for an individually randomized trial by the design effect: DEFF = 1 + (m−1) × ICC, where m is the average cluster size.
When to use it
Cluster randomization is appropriate when: (1) the treatment is applied at the group level (e.g., village water supply, school-level curriculum); (2) spillovers from treated to control individuals within a cluster are a serious concern; or (3) individual-level randomization is operationally or ethically infeasible. The cost in statistical power is the design effect — a CRT with ICC = 0.10 and cluster size 20 requires nearly three times as many individuals as an equivalent individual RCT, just to get the same number of independent information units.
How it works
Power calculation for a CRT. The effective sample size in a CRT is N_eff = N / DEFF = N / (1 + (m−1) × ρ), where N is the total number of individuals, m is the average cluster size, and ρ is the ICC. Given an ICC assumption, the minimum detectable effect (MDE) for a CRT is:
MDE = z_(α/2) + z_(β)) × σ × sqrt(2 × DEFF / N)
where σ is the outcome standard deviation. The MDE scales up by sqrt(DEFF) relative to an individual RCT.
Cluster-level vs. individual-level analysis. Two valid analytical approaches exist:
- Cluster-level analysis: aggregate outcomes to the cluster level (cluster means), then perform a t-test or regression at the cluster level. This approach is conservative (uses only J observations where J is the number of clusters) and ignores within-cluster variation.
- Individual-level analysis with cluster-robust standard errors: regress individual outcomes on treatment, controlling for cluster-level confounders, and cluster the standard errors at the cluster level. This approach uses all individual observations and is more powerful than cluster-level analysis when within-cluster variation is informative.
Partial cluster designs. In some settings, a sub-sample of individuals within each cluster is surveyed. The sampling fraction within clusters affects power; sampling more individuals per cluster is valuable only up to a point (additional observations beyond the effective sample size ceiling add little information).
Key decisions
Number of clusters vs. cluster size. Power in a CRT is more sensitive to the number of clusters than to the number of individuals per cluster, especially when ICC is high. Adding 10 new clusters is almost always more valuable than adding 50 individuals to existing clusters (when ICC > 0.05). Budget allocation should prioritise increasing cluster count.
ICC source. ICC must be assumed before the study for power calculations. Using an ICC from a similar setting and outcome is strongly preferred. If no prior ICC data exist, sensitivity analyses over a range of plausible ICCs (0.01, 0.05, 0.10, 0.20) should be reported.
Partial vs. complete enumeration. Enumerating all individuals in each cluster is rare and costly. Sampling a random sub-sample from each cluster is standard. The optimal sampling fraction within clusters depends on the ICC: higher ICC means less benefit from sampling additional individuals within existing clusters, so fewer individuals per cluster and more clusters is more efficient.
Caveats & common mistakes
Ignoring ICC in analysis. Running OLS without clustering standard errors in a CRT dramatically overstates precision. With ICC = 0.10 and cluster size 20, DEFF ≈ 2.9, meaning standard errors are underestimated by about 70% if clustering is ignored. All regressions in CRT analysis must use cluster-robust standard errors or multilevel models.
Too few clusters. Cluster-robust standard errors perform poorly with fewer than 20–30 clusters (Donald & Lang, 2007; Cameron & Miller, 2015). With 10 or fewer clusters, inference requires alternative methods: randomization inference, wild cluster bootstrap, or cluster-level analysis with the t-distribution and J−2 degrees of freedom. Never report cluster-robust standard errors with fewer than 15 clusters without noting this limitation.
Confounding enumerator assignment with cluster assignment. If each enumerator is assigned to a single cluster, enumerator effects and cluster effects are perfectly confounded. Cross-assigning enumerators to clusters — even a few enumerators covering multiple clusters — helps disentangle them.
Analysis Guide
import pandas as pd
import numpy as np
import statsmodels.formula.api as smf
from scipy.stats import norm
# 1. Design parameters and DEFF — DEFF captures how much within-cluster correlation
# inflates the required sample relative to an individual RCT; DEFF > 1 means
# individuals inside a cluster carry less independent information than if drawn
# independently from the population
icc, m, J = 0.10, 25, 40
sigma, alpha, power = 1.0, 0.05, 0.80
deff = 1 + (m - 1) * icc
# 2. Effective N and MDE — dividing total N by DEFF gives the number of
# independent information units; the MDE formula treats this as the effective
# sample size for power purposes
N_eff = J * m / deff
mde = (norm.ppf(1 - alpha/2) + norm.ppf(power)) * sigma * np.sqrt(2 / N_eff)
print(f"DEFF = {deff:.2f} | Effective N = {N_eff:.0f} | MDE = {mde:.3f}")
# 3. Cluster-level random assignment — draw 50% of clusters to treatment, then
# merge the assignment back to individuals so every unit in a cluster shares
# its cluster's treatment status
np.random.seed(42)
clusters = df["cluster_id"].unique()
treated = np.random.choice(clusters, size=len(clusters)//2, replace=False)
df["treatment"] = df["cluster_id"].isin(treated).astype(int)
# 4. Individual-level regression with cluster-robust SEs — cov_type='cluster'
# with the cluster ids in cov_kwds accounts for within-cluster residual
# correlation; omitting clustering shrinks SEs by roughly sqrt(DEFF)
fit = smf.ols("outcome ~ treatment + baseline_covariate", data=df).fit(
cov_type="cluster", cov_kwds={"groups": df["cluster_id"]})
print(fit.summary().tables[1])
# 5. Cluster-level analysis as a robustness check — collapsing to cluster means
# uses only J observations and is conservative, but is immune to any
# misspecification of the within-cluster correlation structure
df_cluster = df.groupby("cluster_id").agg(
outcome=("outcome", "mean"), treatment=("treatment", "mean")).reset_index()
fit_c = smf.ols("outcome ~ treatment", data=df_cluster).fit(cov_type="HC1")
print(fit_c.summary().tables[1]) Reading the output
- DEFF directly tells you how much larger your required sample is compared to an individual RCT: DEFF = 2.9 means you need 2.9× as many individuals to achieve the same power.
- With ICC = 0.10 and cluster size = 25, effective N is roughly 34% of total N — adding more individuals per cluster beyond this point yields diminishing power returns; adding new clusters is more efficient.
- Individual-level analysis with
vce(cluster)orse_type = "CR2"is preferred over cluster-level analysis because it uses within-cluster variation; cluster-level analysis is a valid fallback but inflates standard errors. - Cluster-robust standard errors are unreliable with fewer than 20 clusters (some recommend 30+); with 10–15 clusters, use wild cluster bootstrap or randomisation inference instead.
References
Donald, S. G., & Lang, K. (2007). Inference with difference-in-differences and other panel data. Review of Economics and Statistics, 89(2), 221–233. https://doi.org/10.1162/rest.89.2.221
Donner, A., & Klar, N. (2000). Design and Analysis of Cluster Randomization Trials in Health Research. Arnold.
Murray, D. M. (1998). Design and Analysis of Group-Randomized Trials. Oxford University Press.
Cameron, A. C., & Miller, D. L. (2015). A practitioner’s guide to cluster-robust inference. Journal of Human Resources, 50(2), 317–372. https://doi.org/10.3368/jhr.50.2.317
Duflo, E., Glennerster, R., & Kremer, M. (2007). Using randomization in development economics research: A toolkit. In T. P. Schultz & J. Strauss (Eds.), Handbook of Development Economics, Vol. 4 (pp. 3895–3962). Elsevier.