BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MarinaMag
Fluorite | Level 6

Hello,

 

I want to run a simple OLS regression and include fixed effects eg. for country or firm fixed effects.

Is there a way to do this automatically? 

 

Thank you in advance,

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

@MarinaMag wrote:

Hello,

 

I want to run a simple OLS regression and include fixed effects eg. for country or firm fixed effects.

Is there a way to do this automatically? 

 

Thank you in advance,


If you need to include "country" or "firm" in the model, these are categorical variables and PROC REG does not directly handle categorical variables. You could use PROC GLM which will do regression and does allow you to include categorical variables (by using the CLASS statement).

--
Paige Miller

View solution in original post

4 REPLIES 4
Ksharp
Super User

proc reg .......

model y=x..... /include=  ;

quit;

MarinaMag
Fluorite | Level 6

Thank you for your response.

I tried to use it for country fixed effects and I took this message:

"ERROR 22-322: Expecting an integer constant."

PaigeMiller
Diamond | Level 26

@MarinaMag wrote:

Hello,

 

I want to run a simple OLS regression and include fixed effects eg. for country or firm fixed effects.

Is there a way to do this automatically? 

 

Thank you in advance,


If you need to include "country" or "firm" in the model, these are categorical variables and PROC REG does not directly handle categorical variables. You could use PROC GLM which will do regression and does allow you to include categorical variables (by using the CLASS statement).

--
Paige Miller
MarinaMag
Fluorite | Level 6

Thank you, it works!

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
  • 4 replies
  • 2164 views
  • 3 likes
  • 3 in conversation