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

Hi Everyone,

 

I'm trying to fit a regression model in sas to a default series using macroeconomic variables. I have 6 potential macro variables. 3 of these should be forced to be in the model (gdp, cpi and prime). 

 

I have 24 lags on each of  the variables (i.e. gdp lag1, gdp lag2 .... gdp lag 24). I would like to force the 3 core variables (gdp, cpi, prime) or any of their variables (lag1 - lag 24) into the model while testing the remaining 3 variables (hddi, hpi and vsr) to get the best fit. I'm allowing for 6 variables in the model.

 

Thus, I'm looking for a potential model that looks like this (for example)

def_rate = gdp_lag18 + prime_lag2 + cpi_lag6 + hddi_lag12

 

or

 

def_rate = gdp_lag8 + prime_lag15 + cpi_lag8 + hddi_lag2 + hpi_lag1

 

etc.

 

Point is I would like to force the proc regression model to include the 3 core macrovariables and any of their variants. Does anyone know an easy way to do this?

 

I'm aware of the include= function, but I don't think you can specify either/or in the option (for instance it can be GDP_lag 2 or GDP_Lag15 ,but must include GDP, prime and cpi)

 

I know one can also output every model possible by not specifying in the best =  function, and then filter on your output, just don't think this is the optimal method because you will be fitting thousands of models.

 

Thanks!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

You might want to try the GROUPNAMES= option in MODEL statement of PROC REG. That may or may not do what you are asking.

 

A better solution, in my opinion, is to fit a Partial Least Squares model (PROC PLS) and then all of your variables are included in the model, in such a way that the effect of multi-collinearity is reduced. See here for an example of a PLS model which had 1000 highly correlated predictor variables and used them all and produced a usable model. One benefit is that all this effort to select variables to put into the model is eliminated or reduced.

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

You might want to try the GROUPNAMES= option in MODEL statement of PROC REG. That may or may not do what you are asking.

 

A better solution, in my opinion, is to fit a Partial Least Squares model (PROC PLS) and then all of your variables are included in the model, in such a way that the effect of multi-collinearity is reduced. See here for an example of a PLS model which had 1000 highly correlated predictor variables and used them all and produced a usable model. One benefit is that all this effort to select variables to put into the model is eliminated or reduced.

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 235 views
  • 0 likes
  • 2 in conversation