Double Clustering by Firm and Date
A way of computing standard errors for a stock-by-month regression that accounts for both directions of correlation in the data at once — a stock's own persistence over time, and the fact that all stocks move together in some months.
Prerequisites: Clustered Standard Errors
A regression of stock returns on some firm characteristic, run on a panel of many stocks over many months, has correlation running in two directions at once: a given stock's returns are correlated with its own past returns (firm-level persistence), and all stocks' returns in a given month are correlated with each other (market-wide shocks hit everyone the same month). Clustering standard errors by firm alone fixes the first problem but not the second; clustering by month alone fixes the second but not the first. Double clustering — clustering by firm and by date simultaneously — fixes both at once, and has become close to a default choice for this kind of panel regression in empirical finance.
How it works, in outline
The mechanics build the same underlying idea (cluster-robust variance estimation) three times and combine them: once clustering by firm, once clustering by date, and once clustering by the combination of firm-and-date (which for panel data with one observation per stock-month is just each individual observation). Adding the firm-clustered and date-clustered variance estimates together and then subtracting the individual-observation variance estimate gives the two-way clustered standard error — a formula that avoids double-counting the correlation that both single clusterings would otherwise credit twice.
The practical effect is usually to widen standard errors (and shrink t-statistics) relative to using either single-direction clustering alone, because double clustering is acknowledging more of the true correlation structure in the data rather than ignoring one direction of it. A coefficient that looked comfortably significant under firm-only or date-only clustering can become marginal, or lose significance entirely, once both directions are accounted for — which is exactly why checking which clustering method underlies a reported result matters before trusting it.
A concrete example
A cross-sectional regression of next-month stock return on a valuation ratio, run across 2,000 stocks and 240 months. Clustered by firm only, the coefficient's t-statistic is 3.1. Clustered by month only, it's 2.6. Double-clustered by firm and month, it drops to 2.0 — still significant at conventional levels, but noticeably weaker than either single-direction clustering suggested, because both a persistent firm effect and a shared monthly market effect were present in the data and only the double-clustered estimate accounts for both simultaneously.
Double clustering by firm and date corrects standard errors for both firm-level persistence over time and market-wide comovement within a period at once, and typically produces wider, more honest standard errors than either single-direction clustering alone. It has become close to a default choice for panel regressions in empirical asset pricing.
Related concepts
Practice in interviews
Further reading
- Petersen, 'Estimating Standard Errors in Finance Panel Data Sets: Comparing Approaches', Review of Financial Studies (2009)
- Cameron, Gelbach & Miller, 'Robust Inference with Multi-Way Clustering', JBES (2011)