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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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
  • 3596 views
  • 0 likes
  • 2 in conversation