Tuesday, January 20, 2026

Often Subtle Differences Across: xtreg, reghdfe, regress (+ dummies), and areg Commands

An interesting question emerged on the StataList discussion board relating to how distinct (though similar) regression commands can generate different panelvar clustering standard errors (click here). More specifically, while the standard errors generated by the xtreg and regdfe commands are the same they can also differ from the standard errors generated by the regress (+ dummy vars) and the areg commands (which also match each other).

As the discussion illustrates, panel data sets typically require the xtreg or reghdfe command as these are panel data estimators. The regress (+ dummy vars) and areg commands can, in certain instances, penalize the degrees of freedom associated with the fixed effects, which should not happen when the panel variable and the cluster variable coincide.