BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
gabriel_k
Obsidian | Level 7

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller
gabriel_k
Obsidian | Level 7

Thanks.Good guess:)

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

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