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
- /
- SAS Programming
- /
- General Programming
- /
- Regression-Model Validation

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

11-08-2012 03:00 PM

I have used training data set to construct a number of models for a regression problem.

If one of the candidtae models is Yi=Bo+B1X1 +B2X2+........B10X10 +E

How can I test this model using validatation data set? The stats I am looking for are Rsqd, AdjRsqd, AIC,SSE,etc.

Thanks in advance for your help.

Accepted Solutions

Solution

11-09-2012
07:43 PM

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

11-09-2012 07:43 PM

No reference, sorry Steve. I am probably reinventing the wheel here. I had done something similar with proc logistic, that's what gave me the idea. - PG

PG

All Replies

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

11-08-2012 03:15 PM

As far as I know, PROC REG does not have built in functions to evaluate the regression on a validation data set.

You can achieve most of what you want by using PROC SCORE to generate predicted values from the model for the validation set, then compute residuals. You'd have to write code to compute R-Squared and the other quantities of interest yourself.

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

11-08-2012 07:49 PM

You can try to trick ROBUSTREG into doing your validation, like this :

**data training;****do x1 = 1 to 5;**** do x2 = 1 to 5;**** do i = 1 to 2;**** y = 3*x1 - 4*x2 + rannor(1234);**** output;**** end;**** end;**** end;****drop i;****run; **

**data test;****do x1 = 1 to 5;**** do x2 = 1 to 5;**** do i = 1 to 2;**** y = 3.2*x1 - 4.3*x2 + rannor(1234);**** output;**** end;**** end;**** end;****drop i;****run;**

**proc reg data=training outest=trainEst;****model y = x1 x2;****run;****quit;**

**proc robustreg data=test inest=trainEst method=m(maxiter=0);****model y = x1 x2;****run;**

PG

PG

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

11-09-2012 07:47 AM

PG,

This is, in the words of Family Guy's Peter Griffin, "&%#!-in' SWEET"! Any references for this? It is something I have been looking for a LONG time.

Steve Denham

Solution

11-09-2012
07:43 PM

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

11-09-2012 07:43 PM

No reference, sorry Steve. I am probably reinventing the wheel here. I had done something similar with proc logistic, that's what gave me the idea. - PG

PG

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

11-11-2012 10:40 AM

Thanks, PG stat for your 'INVENTION'. I used R for this problem. The same question was posted by different users a couple of times on this site...non of them were answered correctly. I will share this code with my friends!!!

Thank you very much.

Raghu.