Programming the statistical procedures from SAS

Proc Reg - Getting Adjusted R Squared in each step of a Backward Regression

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Proc Reg - Getting Adjusted R Squared in each step of a Backward Regression

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


Accepted Solutions
Solution
‎02-22-2016 05:10 PM
SAS Super FREQ
Posts: 3,304

Re: Proc Reg - Getting Adjusted R Squared in each step of a Backward Regression

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


All Replies
Solution
‎02-22-2016 05:10 PM
SAS Super FREQ
Posts: 3,304

Re: Proc Reg - Getting Adjusted R Squared in each step of a Backward Regression

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.

New Contributor
Posts: 2

Re: Proc Reg - Getting Adjusted R Squared in each step of a Backward Regression

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

☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 327 views
  • 2 likes
  • 2 in conversation