An Introduction to Understanding and Teaching Within-Cluster Correlation in Complex Surveys

Document Type


Publication Date



This econometrics pedagogy note points to online material that demonstrates the importance of using cluster standard errors (SEs) with data generated from complex surveys. Simulation is used to show that both classic ordinary least squares and robust SEs perform poorly in the presence of within-cluster correlated errors, while cluster SEs perform much better. We take advantage of Excel’s spreadsheet interface to produce clear and intuitive visuals of the data generation process and explain key results. Customizable Stata and R implementations, which help in further analysis by taking advantage of the unique different capabilities of Stata and R, are also provided. We conclude with suggestions for how to use these files in the classroom.