turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Proc Reg - Getting Adjusted R Squared in each step...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-22-2016 03:52 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-22-2016 04:35 PM

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.

All Replies

Solution

02-22-2016
05:10 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-22-2016 04:35 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-22-2016 05:12 PM

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