proc expand data=data out=MoveAv method=none ;
id MONTH1;
convert number = MA / transout=(movave 5);
convert number = WMA / transout=(movave(1 2 3 4 5));
convert number = EWMA / transout=(ewma 0.3);
run;
proc sgplot data=MoveAv cycleattrs;
series x=month1 y=MA / name='MA' legendlabel="MA(5)";
series x=month1 y=WMA / name='WMA' legendlabel="WMA(1,2,3,4,5)";
series x=month1 y=EWMA / name='EWMA' legendlabel="EWMA(0.3)";
scatter x=month1 y=number;
keylegend 'MA' 'WMA' 'EWMA';
xaxis display=(nolabel) grid;
yaxis label="Closing Price" grid;
run;This is my code. My code contains the date variable:"month1" (every month numbers from jan2019 to may2020) and customer number variable "number". I want to forecast the future 6 months' data using moving average method but proc expand only give me the moving average data from jan2019 to may2020. I don't want to using proc forecast. Only want to use moving average method. Are there any option in the proc expand can provide me the future moving average data?
thank you in advance
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.