BookmarkSubscribeRSS Feed
amanjot_42
Fluorite | Level 6

Hi guys,

 

Can you please help me in running my regression equation with industry and year fixed effects. I tried looking at the other posts, but could not gather much about the same. I have two independent variables and want to append industry and year fixed effects in the regression model:

Dependent variable: Y

Independent variables: X1 and X2

Fixed Effects: Industry and Year fixed effects

 

Regards

Aman

5 REPLIES 5
Rick_SAS
SAS Super FREQ

I assume that X1 and X2 are also fixed effects, but Industry and Year are categorical variables? If so, try using PROC GLM like this

 

proc glm data=Have;
class Industry Year;
model Y = X1 X2 Industry Year / solution;
run;
quit;

If you want to discuss details, we can use one of the data sets that SAS distributes:

 

proc glm data=Sashelp.Cars(where=(Type^='Hybrid'));
class Origin Type;
model MPG_City = Horsepower EngineSize Origin Type / solution;
run;
amanjot_42
Fluorite | Level 6
hi,
thanks for your reply, after running the code, the screen goes blank with no further updations or results?!
Rick_SAS
SAS Super FREQ

Please post the exact code you submitted and also the SAS log. My guess is that you have a syntax error.

amanjot_42
Fluorite | Level 6
Hi,
I am using the following code:
proc glm data=Have;
class Industry Year;
model Y = X1 X2 Industry Year / solution;output out=result r=residuals;run;
quit;

Rick_SAS
SAS Super FREQ

That code will work if your data set is named HAVE and it contains variables named Y, X1, X2, Industry, and Year. (And Industry and Year have a relatively small number of levels.)  Unless you are excluding the ODS output, the procedure will display tables. 

 

If your data set or variables have a different name, there will be an error message in the SAS log, so please post the entire SAS log, as requested previously, so that we can see the exact code you submitted and the SAS notes, warnings, and errors.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 3123 views
  • 0 likes
  • 2 in conversation