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;
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.
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.