Turn on suggestions

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

Showing results for

- Home
- /
- Analytics
- /
- Forecasting
- /
- What is the difference between a forecast and prediction in SLR?

Options

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

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 02-23-2022 12:29 PM
(411 views)

I need an equation for a forecast for a simple regression problem(SLR). Please note I am not asking for a prediction value but a forecast. I could not find this in the ETS documentation. Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

I have NOT downloaded your *.sas file.

But I want to correct something :

SAS/ETS is not suitable for a single | simple linear regression (SLR), you should do that with SAS/STAT (PROC REG for example).

Moreover, every forecast is a prediction, but not every prediction is a forecast. A forecast looks into the future (generally) and is a time series prediction. A "prediction" as a term is much broader and is any kind of prediction.

I am not sure what your question is for the rest.

Will that become clear when I open the programme?

Can you copy / paste the programme into a reply?

Click on the running man in the toolbar when writing your reply. You can then paste your SAS-code into the window that opens.

Thanks,

Koen

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

I have NOT downloaded your *.sas file.

But I want to correct something :

SAS/ETS is not suitable for a single | simple linear regression (SLR), you should do that with SAS/STAT (PROC REG for example).

Moreover, every forecast is a prediction, but not every prediction is a forecast. A forecast looks into the future (generally) and is a time series prediction. A "prediction" as a term is much broader and is any kind of prediction.

I am not sure what your question is for the rest.

Will that become clear when I open the programme?

Can you copy / paste the programme into a reply?

Click on the running man in the toolbar when writing your reply. You can then paste your SAS-code into the window that opens.

Thanks,

Koen

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

```
DATA sixtyEight;
input t y;
cards;
1 47
2 46
3 51
4 44
5 54
6 47
7 52
8 45
9 50
10 51
11 49
12 41
13 48
14 50
15 51
16 55
17 52
18 53
19 48
20 52
;
proc print; run;
proc reg;
model y=t / r p;
run;
```

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

So if your x-variable is a sequence number, then in some sense predicting when the sequence number goes beyond the range of the data could be considered a forecast.

In your case, if you got a predicted value for t=21, is that what you want? (I'll bet there are a lot of people trained in statistics who would not call that a forecast ... nevertheless ... is that what you want?)

If so, you don't really need the equation (although if you want it, that's fine), but this trick here allows you to get a predicted value for t=21.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I do want the predicted value for t=21. I am working with the equation

forecast for time t from time t-1 = yhat(t-1)

=y(t)-e_t(1) where

e_t(1) = step 1 ahead error

Thank you for your reply. MM

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Now you give us an equation that is not linear regression. It involves time series data. So PROC REG is not appropriate, and just plain wrong.

You do want to use SAS/ETS to fit this model and obtain forecasts. And so I will step aside and allow someone who is more familiar with Time Series modeling to recommend a specific model here.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello,

Is it this that you want?

```
data work.sixtyEight;
set work.sixtyEight end=lastobs;
output;
if lastobs then do;
t=21; y=.; output;
end;
run;
proc autoreg data=sixtyEight;
model y=t / NLAG=(1) method=ML;
output out=p p=yhat pm=ytrend
lcl=lcl ucl=ucl;
run;
QUIT;
proc sgplot data=p;
band x=t upper=ucl lower=lcl;
scatter x=t y=y;
series x=t y=yhat;
series x=t y=ytrend / lineattrs=(color=black);
run;
/* end of program */
```

Koen

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.