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

I am running PROC REG on a dataset with a dependent variable and 4 independent variables.  At each elimination step, it shows the variable removed and the new R-Square value.  I would also like to see the new Adjusted R-Square value as the variables are removed.

 

The closest I have found is to do the following:

 

proc reg data=Startups50 outest=est1 rsquare;

model Profit = RD_Spend Administration Marketing_Spend NewYork/ ADJRSQ selection = backward slstay = 0.05;

 

run;

proc print data=est1;

run;

 

Unfortunately, all that shows in dataset est1 is one entry with the final results.

 

Is there a way to have Adjusted R-Square show for each step of the eliminations?

 

Thanks, Jack

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

I recommend that you switch to PROC GLMSELECT, which has many more variable selection techniques and also provides many more diagnostic tables and graphs. For example, see the GLMSELECT documentation example, which is similar to the following:

ods graphics on;
proc glmselect data=sashelp.baseball plot=CriterionPanel;
   model logSalary = nAtBat nHits nHome nRuns nRBI nBB
                  yrMajor crAtBat crHits crHome crRuns crRbi
                  crBB nOuts nAssts nError
                / selection=backward(select=AdjRSq) stats=all;
ods select SelectionSummary CriterionPanel;
quit;

 

The ODS SELECT statement is used to select the SelectionSummary table, which shows the AdjRSquared (and many other statistics!) for each iteration. The output also shows a graphical representation of the various fit statistics for each iteration in the CriterionPanel graph.

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

I recommend that you switch to PROC GLMSELECT, which has many more variable selection techniques and also provides many more diagnostic tables and graphs. For example, see the GLMSELECT documentation example, which is similar to the following:

ods graphics on;
proc glmselect data=sashelp.baseball plot=CriterionPanel;
   model logSalary = nAtBat nHits nHome nRuns nRBI nBB
                  yrMajor crAtBat crHits crHome crRuns crRbi
                  crBB nOuts nAssts nError
                / selection=backward(select=AdjRSq) stats=all;
ods select SelectionSummary CriterionPanel;
quit;

 

The ODS SELECT statement is used to select the SelectionSummary table, which shows the AdjRSquared (and many other statistics!) for each iteration. The output also shows a graphical representation of the various fit statistics for each iteration in the CriterionPanel graph.

JackSugrue
Calcite | Level 5

Thanks, Rick.  That gave me what I needed.  I added "ParameterEstimates" to the ods select  and I now have what I was looking for.

 

Appreciate the help!

 

Jack

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 2 replies
  • 8990 views
  • 2 likes
  • 2 in conversation