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
- /
- Base SAS Programming
- /
- iterative multiplication/addition

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

09-09-2016 09:59 AM

Hi all,

I have built a regegression in SAS, now i have my coeffiients. I now wish to forecast. I have a table with two columns Date and Variable1. I would like to write in sas the ability to create 2 new columns (1, the output of hte regression - what is y), 2 the cumulative balance. )

y=alpha+beta(variable1)

alpha and beta are defiend. i wish for the first new column to be the values of y and the second column to be (1+y_t)(1+y_(t-1)

i'm having trouble figuring out how to write a loop or macro that enables me to actually build out what woudl be quite easy in excel - just the ability to forecast over time. below is an image that outlines what i'm trying to do. assume the following example.

Any help would be very much appreciated

Accepted Solutions

Solution

09-15-2016
09:34 AM

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

09-09-2016 10:25 AM

It helps to have some actual data but this is easy with RETAIN for the cumulative value.

You should also examine the concept of Scoring, applying the regression model to another data set.

```
data want;
set have;
retain cumulative .
y= alpah +beta(variable1);
cumulative = sum(cumulative,y);
run;
```

All Replies

Solution

09-15-2016
09:34 AM

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

09-09-2016 10:25 AM

It helps to have some actual data but this is easy with RETAIN for the cumulative value.

You should also examine the concept of Scoring, applying the regression model to another data set.

```
data want;
set have;
retain cumulative .
y= alpah +beta(variable1);
cumulative = sum(cumulative,y);
run;
```