by Joachim Gassen and David Veenman
This repository provides an overview of and the links to Stata programs for twoway fixed effects and multiway standard error clustering for robust regression estimators. The repository accompanies our study "Estimation Precision and Robust Inference in Archival Research" (https://ssrn.com/abstract=4975569).
-
robtwfe(https://github.com/dveenman/robtwfe/): this program can be used to combine Huber M-estimation with two-way fixed effects (FE). For a firm-time panel dataset, the program mimicsrobregfor Huber M-estimation with one FE dimension (firm) absorbed and the other FE dimension (time) included as indicator variables. Instead of including the time indicator variables, the program leverages (a) the functionality ofreghdfeand (b) the fact that the iterative reweighting in the robust estimation relies on a sequence of weighted least squares estimations, which can be combined with two-way FE usingreghdfe. When the second (time) dimension becomes sufficiently large (e.g., >50), the program is substantially faster thanrobregand provides the same estimates. -
robcluster2(https://github.com/dveenman/robcluster2/): this program produces multiway cluster-robust standard errors for a robust regression estimator. It computes standard errors for robust estimators based on equation 3.11 of Croux, Dhaene, and Hoorelbeke 2003. Multiway clustered standard errors are obtained based on (1) the intuition of Zeileis, Koll, and Graham (2020) for sandwich estimators to obtain cluster-robust standard errors and (2) the formulas for multiway cluster-robust standard errors from Thompson (2011), Cameron, Gelbach, and Miller (2011), and Gu and Yoo (2019). Significance levels of reported t-values are based on the degrees of freedom defined by the cluster dimension with the lowest number of unique clusters (G-1). -
roboot(https://github.com/dveenman/roboot/): this program produces bootstrapped standard errors for MM-estimators using the fast bootstrap procedure described by Salibian-Barrera and Zamar (2002). The robust estimator inrobootis the MM-estimator defined byrobreg mm, but the program requires an explicit input for the level of normal efficiency. The program produces MM-estimates with bootstrapped standard errors without cluster-adjustment, one-way cluster-robust standard errors, or twoway cluster-robust standard errors. The bootstrapped standard errors are derived from the standard deviations of B bootstrap samples drawn from the sample with replacement. One-way cluster-robust bootstrapped standard errors are obtained similarly by drawing entire clusters of data from the sample with replacement. Twoway cluster-robust standard errors are obtained using the formula from Thompson (2011) and Cameron, Gelbach, and Miller (2011). The cluster-robust versions rely on the computational efficiency of drawing low-dimensional matrices per cluster as described by MacKinnon (2022), which further speeds up the bootstrap procedure.