BookmarkSubscribeRSS Feed
abdulla
Pyrite | Level 9

Hi,

abdulla_0-1621619602308.png

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?

 

 

1 REPLY 1
sbxkoenk
SAS Super FREQ

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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 662 views
  • 1 like
  • 2 in conversation