I am running the a firm fixed effect regression to find the residual, but the error message says my CLASS variable has only one level.
My regression has only one independent variable which I call it 'independent_variable_TACC', and the dependent variable is 'dependent variable_BTD'. I used PROC REG to get residuals before by adding a '/r' after MODEL command, but it seems like PROC GLM does not work in that way. I attached my codes herewith. I am not sure if I need to add both firm_code (gvkey) and year (fyear) in CLASS or only firm_code is needed.
Can anyone tell me how do I get the residual from a firm fixed effect regression? I really appreciate for any help with this problem. Thanks a lot in advance.
proc glm data=rep.DD_BTD_regression;
class gvkey fyear; /*firm fixed effect*/
by gvkey fyear;
output out=rep.DD_BTD_residuals /*new data set with residual*/
r=DD_BTD_resid; /*the residual I need*/
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.