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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.