BookmarkSubscribeRSS Feed
arsinha
Fluorite | Level 6

Hello!

I have a regression model of the form y=B1*x1 + B2*x2 + B3*x3 . There are equal number of observations for all the x variables. Now I want to predict a value of Y with the specific values of x-variables, that are not in the given data set. My question is how do I add values to x1,x2,x3 along with the existing values.  

To be clear, suppose x1,x2,x3 each have 20 values. how do I add the 21st observation for each of them so that i get predicted value of y at those x-points.

I know this is a crude way of getting a predicted value from  a regression model. 

 

Thank You.

2 REPLIES 2
Reeza
Super User

Here's a full write up of two different approaches. 

 

https://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html

 

https://blogs.sas.com/content/iml/2014/02/17/the-missing-value-trick-for-scoring-a-regression-model....

 


@arsinha wrote:

Hello!

I have a regression model of the form y=B1*x1 + B2*x2 + B3*x3 . There are equal number of observations for all the x variables. Now I want to predict a value of Y with the specific values of x-variables, that are not in the given data set. My question is how do I add values to x1,x2,x3 along with the existing values.  

To be clear, suppose x1,x2,x3 each have 20 values. how do I add the 21st observation for each of them so that i get predicted value of y at those x-points.

I know this is a crude way of getting a predicted value from  a regression model. 

 

Thank You.


 

Astounding
PROC Star
Do you know how to create a new data set with a new set of values for x1, x2, and x3?

Do you know how to combine two SAS data sets?

Do you know how to add a formula to assign a value to y?

These are all simple things to do. It's just difficult to see which pieces you know and which you don't know.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1976 views
  • 1 like
  • 3 in conversation