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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1679 views
  • 0 likes
  • 2 in conversation