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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1456 views
  • 1 like
  • 3 in conversation