turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Proc Reg; How to predict new observation?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-02-2016 03:03 PM

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.

Accepted Solutions

Solution

06-06-2016
01:22 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-02-2016 03:41 PM

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.

All Replies

Solution

06-06-2016
01:22 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-02-2016 03:41 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-06-2016 01:22 PM

Thank you!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-02-2016 03:41 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-02-2016 05:37 PM

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