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

Hey everyone,

I am modelling variables with a two-way fixed effects model in SAS 9.4, in proc panel.

Do you know if there is a way to use the "selection"stepwise" option in the panel procedure? And if now, do you have any tips to automatically select your variables using for example the information critera?

Thank you in advance,

F.

1 ACCEPTED SOLUTION

Accepted Solutions
ets_kps
SAS Employee

I have been thinking about this one and here is an idea.  

1) Time and cross-sectionally demean your data.  How to do this is shown here. SAS/ETS(R) 14.1 User's Guide You will likely want to use some form of PROC TIMESERIES or some PROC MEANS calls to do this. 

2) Now that the data are "demeaned" a simple OLS estimate would give you your "Two-way FE" estimates.  From here you could then extend this regression by using PROC REG or perhaps better, PROC GLMSELECT SAS/STAT(R) 14.1 User's Guide

and use whatever variable selection method you prefer.   In essence, it would force FE into your model, with whatever final specification the algorithm chooses.

*would love to see some of your results. 

Good luck-Ken

View solution in original post

2 REPLIES 2
ChaseO
Calcite | Level 5

Hi Flora,

To my knowledge, PROC PANEL does not have a stepwise option. I'm not a fan of automatic selection, but there are a number of things you can do to go down that path. Given that the panel membership is reasonably highly correlated, you could pick a test subject and perform a stepwise OLS regression. Or similarly, perform a stepwise regression on the panel average. You could also produce ranked pairwise correlations to provide guidance while manually model building. On the complex side, you could write a macro for a panel stepwise selection using AIC/BIC instead of Rsq.

Hope this helps!

ets_kps
SAS Employee

I have been thinking about this one and here is an idea.  

1) Time and cross-sectionally demean your data.  How to do this is shown here. SAS/ETS(R) 14.1 User's Guide You will likely want to use some form of PROC TIMESERIES or some PROC MEANS calls to do this. 

2) Now that the data are "demeaned" a simple OLS estimate would give you your "Two-way FE" estimates.  From here you could then extend this regression by using PROC REG or perhaps better, PROC GLMSELECT SAS/STAT(R) 14.1 User's Guide

and use whatever variable selection method you prefer.   In essence, it would force FE into your model, with whatever final specification the algorithm chooses.

*would love to see some of your results. 

Good luck-Ken

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 2212 views
  • 0 likes
  • 3 in conversation