Clustering on the interaction term would be
Code:
egen cou_year = group(country year) reghdfe y x1 x2 , absorb(cou_year)
Code:
reghdfe y x1 x2 , absorb(country#year) vce(cluster country#year)
Code:
reghdfe y x1 x2 , absorb(country#year) vce(cluster country year)
Also, I tried using 'felm' package in R. The results of these two ways are exactly the same.
However, when using 'reghdfe' in Stata, if I do in by clustering on the interaction terms, there would be a warning 'Warning: variance matrix is nonsymmetric or highly singular' and the standard errors cannot be estimated.
Thank you!
0 Response to Two way clustering versus clustering on the interaction term?
Post a Comment