Solved
Contributor
Posts: 21

PROC REG test sample

Hello, I use PROC REG for Multiple Linear Regression. Is there an integrated way to apply the model to a test sample or get the comlete equation (B0+B1*X1+B2*X2...) when there is a considerable number of variables? Thanks.

Accepted Solutions
Solution
‎10-31-2015 06:59 PM
Trusted Advisor
Posts: 1,933

Re: PROC REG test sample

[ Edited ]
Posted in reply to gabriel_k

gabriel_k wrote:

Hello, I use PROC REG for Multiple Linear Regression. Is there an integrated way to apply the model to a test sample

I don't know what "test a sample" means but I am going to guess (always a dangerous thing) that you really mean get predicted values for certain observations. This can be done using the OUTPUT statement in PROC REG. If the observation(s) you want to predict is not in the original data set used to create the regression, then you can append this observation(s) to the data set before you create the regression, leave the response variable missing, and the predicted value for this observation(s) will be in the OUTPUT data set.

The equation is contained in the data set created by the OUTEST option.

All Replies
Solution
‎10-31-2015 06:59 PM
Trusted Advisor
Posts: 1,933

Re: PROC REG test sample

[ Edited ]
Posted in reply to gabriel_k

gabriel_k wrote:

Hello, I use PROC REG for Multiple Linear Regression. Is there an integrated way to apply the model to a test sample

I don't know what "test a sample" means but I am going to guess (always a dangerous thing) that you really mean get predicted values for certain observations. This can be done using the OUTPUT statement in PROC REG. If the observation(s) you want to predict is not in the original data set used to create the regression, then you can append this observation(s) to the data set before you create the regression, leave the response variable missing, and the predicted value for this observation(s) will be in the OUTPUT data set.

The equation is contained in the data set created by the OUTEST option.

Contributor
Posts: 21

Re: PROC REG test sample

Posted in reply to PaigeMiller

Thanks.Good guess

🔒 This topic is solved and locked.

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

Discussion stats
• 2 replies
• 460 views
• 0 likes
• 2 in conversation