Hi,
Eq. (1) is estimated for each industry-year with at least 20 observations.
The above is from a published paper. The goal is to calculate residuals. From the above, I understood that before running regression, we have to sort observations by industry and year and then run the regression.
For that, I did the following
proc sort data=have;
by industry year ; Run;
Proc reg data=have noprint;
by industry year;
model Inv=sales_growth;
output out=want r=res;
Now, I wanted to verify whether this is similar to using industry- year fixed effect. I did the following
proc glm data=have noprint;
class Industry year;
model Inv = sales_growth industry year / solution;
output out=want r=res2;
run;
quit;
When I checked the residuals, I found that they are different. I am not sure why? Why will we choose one vs the other? Which one is preferable and why, on the basis of econometric consideration? The paper has no explanation why they did what they did. Could anyone please suggest me anything or confirm that I am doing things correctly in the first regression? Or Am I making mistakes here?
Hello,
I haven't read it in detail, but I think your question is addressed in this blog:
The difference between CLASS statements and BY statements in SAS
By Rick Wicklin on The DO Loop February 14, 2018
https://blogs.sas.com/content/iml/2018/02/14/difference-class-and-by-statements-sas.html
There's a section:
Predicted Values: CLASS VARIABLE versus BY Variable
You would certainly have got an earlier response by posting this topic in 'Statistical Procedures' under the 'analytics' heading with a title like: Industry-Year fixed effects Vs. separate models by Industry-Year.
Good luck,
Koen
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.