Hello,

I'd like to utilize year and industry fixed effects regression and calculate t-statistics using standard errors clustered by firm and year.
I am not sure if the below code is the correct way.

Code:
ssc install reghdfe
Code:
ssc intall ftools
Code:
reghdfe var1 var2, absorb(sic_2 fyear) vce (cluster id fyear)
,where sic_2 = industry classification, fyear= fiscal year, id= unique firm identifier

I've also tried using
Code:
xtset
and
Code:
xtreg
, but that doesn't seem to allow this kind of clustering
Code:
Code:
xtset sic_2
xtreg var1 var2 i.fyear, fe vce (cluster id)
Can anyone help out if this is the right approach?