Dear Stata Users,

I am trying to estimate a model with industry and year fixed effects with standard errors clustered at the firm level. From this regression I need to save the residuals. For this I use the code below. Please, correct me if I am wrong:

Code:
reghdfe y x1 x2 x3 x4, absorb(industry year) vce(cluster firm_ID)

predict e, residuals