Programming the statistical procedures from SAS

simple OLS regression with fixed effects

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

simple OLS regression with fixed effects

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,


Accepted Solutions
Solution
‎06-13-2018 01:45 PM
Respected Advisor
Posts: 3,040

Re: simple OLS regression with fixed effects

Posted in reply to MarinaMag

@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


All Replies
Super User
Posts: 10,784

Re: simple OLS regression with fixed effects

Posted in reply to MarinaMag

proc reg .......

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

quit;

Occasional Contributor
Posts: 5

Re: simple OLS regression with fixed effects

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."

Solution
‎06-13-2018 01:45 PM
Respected Advisor
Posts: 3,040

Re: simple OLS regression with fixed effects

Posted in reply to MarinaMag

@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
Occasional Contributor
Posts: 5

Re: simple OLS regression with fixed effects

Posted in reply to PaigeMiller

Thank you, it works!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 132 views
  • 3 likes
  • 3 in conversation