Multi-stage (cluster) sampling is a common sampling design in which the unit of [[Randomization in Stata | randomization]] differs from the [[ Unit of Observation | unit of observation]]. In other words, the unit at which the treatment is assigned (i.e. community, school) is different than the unit at which surveys are administered (i.e. household, student). This page explains multi-stage (cluster) sampling and provides a demonstration of how to implement it in Stata.
[[Clustered Sampling and Treatment ]]
*The number of clusters in a research design is closely related with [[Sampling & Power Calculations | sampling and power calculations]].
*When randomizing between clusters, make sure to cluster standard errors during [[Data Analysis | data analysis]].
* Multi-stage (cluster) sampling must typically be implemented manually. It relies on subsetting the data intelligently to the desired assignment levels.
*For more information on multi-stage (cluster) sample size calculations, see [[Sample_Size#Additional factors for clustered sampling | Additional Factor for Clustered Sampling ]] on the [[Sample Size]] page.
Many studies collect data at a different level of observation than the randomization unit. Consider, for example, a researcher who wants to measure the household-level effects of a village-level water sanitation program, or a researcher who wants to measure the student-level effects of a school-level food program. This research design, in which units are assigned to treatments in clusters, is called clustering.
===How Many Clusters?===
To test a program impact convincingly and to precisely estimate treatment effects, it is important to use a sufficient number of clusters. With a small number of clusters, the treatment and control clusters are likely not identical; however, as the number of clusters increases, the more similar and balanced the treatment and control clusters become and the, accordingly, the treatment effect estimate becomes more precise. Typically, clustered sampling designs should include at least 40-50 clusters in each treatment and control group in order to obtain sufficient power and [[Balance tests | balance at baseline]] [https://siteresources.worldbank.org/EXTHDOFFICE/Resources/5485726-1295455628620/Impact_Evaluation_in_Practice.pdf]. The exact number of clusters depends on the intra-cluster correlation, [[Sampling & Power Calculations | sampling and power calculations]] and the [[Survey Budget | budget]], as more clusters is generally more costly.
In multi-stage (cluster) sampling, since the treatment is assigned to clusters, there are fewer randomized groups than the number of units in the data. Therefore, at the [[Data Analysis | data analysis stage]], standard errors for clustered designs must be clustered at the level at which the treatment was assigned.
Multi-stage (cluster) sampling must typically be implemented manually. It relies on subsetting the data intelligently to the desired assignment levels. A demonstration follows:
// Use [randtreat] in randomization program
cap prog drop my_randomization
prog def my_randomization
// Syntax with open options for [ritest]
cap drop treatment
cap drop cluster
//Create cluster indicator
egen cluster = group(sex agegrp) , label
label var cluster "Cluster Group"
// Keep only one from each cluster for randomization
egen ctag = tag(cluster)
keep if ctag == 1
// Group 1/2 in control and treatment
generate(treatment) /// New variable name
multiple(2) /// Two arms
// Apply assignment to entire cluster
save `ctreat' , replace
merge m:1 cluster using `ctreat' , nogen
lab var treatment "Treatment Arm"
lab def treatment ///
0 "Control" ///
1 "Treatment " ///
lab val treatment treatment
// Reproducible setup: data, isid, version, seed
sysuse bpwide.dta , clear
isid patient , sort
set seed 796683 // Timestamp: 2019-02-26 22:14:17 UTC
ta cluster treatment
== Back to Parent ==
This article is part of the topic [[Sampling & Power Calculations]]
== Additional Resources ==
*Better Evaluation’s [http://betterevaluation.org/en/evaluation-options/multistage Multistage Clustering] resource
*DIME Analytics' presentations on randomization [https://github.com/worldbank/DIME-Resources/blob/master/stata1-5-randomization.pdf 1] and [https://github.com/worldbank/DIME-Resources/blob/master/stata2-5-randomization.pdf 2], which cover clustering
*[https://blogs.worldbank.org/impactevaluations/when-should-you-cluster-standard-errors-new-wisdom-econometrics-oracle This World Bank Blog] discusses when you should cluster standard errors.
[[Category: Sampling & Power Calculations ]]