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
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;
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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.