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

Hello,

I was wondering, how in the Proc Reg procedure can you simply predict a value, with a prediction interval, for a new observation?  Such as, you run proc reg and get the regrssion equation, then I want to calculate the predicted value and prediction interval when x=5.5.

I am using SAS 9.4

 

proc reg data=regression;

model y= x

run;

Thank you,
Jeff S. O.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Easiest is often to include X (predictor) value(s) of interest with missing for the dependent variables.

Then either options on the Model Statement or create an output set:

Output out=want p=Ypredicted LCL=ylowerin LCLM=ylowermean UCL=yupperin UCLM=yuppermean;

 

Ypredicted would be the associated Predicted Y for any X, including the ones with missing Y, the LCL and LCLM do lower confidence limits for single obs or the mean and UCL UCLM for the upper.

 

 

View solution in original post

4 REPLIES 4
ballardw
Super User

Easiest is often to include X (predictor) value(s) of interest with missing for the dependent variables.

Then either options on the Model Statement or create an output set:

Output out=want p=Ypredicted LCL=ylowerin LCLM=ylowermean UCL=yupperin UCLM=yuppermean;

 

Ypredicted would be the associated Predicted Y for any X, including the ones with missing Y, the LCL and LCLM do lower confidence limits for single obs or the mean and UCL UCLM for the upper.

 

 

Jolly
Calcite | Level 5

Thank you!

Reeza
Super User

Look at Proc Score. 

 

A quick and dirty method is to include the values in your original dataset but leave the dependent variable blank/missing. 

Then use the output statement with the p= option to get the predicted values out. 

sbxkoenk
SAS Super FREQ

To deploy a PROC REG model on new data , Look at PROC SCORE.

SAS/STAT(R) 14.1 User's Guide

The SCORE Procedure

Example 100.2 Regression Parameter Estimates
 
See also:
Usage Note 33307: Scoring (computing predicted values) for new observations or a validation data set
 
Koen

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 33477 views
  • 1 like
  • 4 in conversation