Solved
Contributor
Posts: 66

# Regression-Model Validation

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.

Accepted Solutions
Solution
‎11-09-2012 07:43 PM
Posts: 5,521

## Re: Regression-Model Validation

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
Posts: 2,989

## Re: Regression-Model Validation

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.

--
Paige Miller
Posts: 5,521

## Re: Regression-Model Validation

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
Posts: 2,655

## Re: Regression-Model Validation

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
Posts: 5,521

## Re: Regression-Model Validation

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
Contributor
Posts: 66

## Re: Regression-Model Validation

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.

🔒 This topic is solved and locked.