BookmarkSubscribeRSS Feed
hardtonamed
Calcite | Level 5
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

1 REPLY 1

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 746 views
  • 0 likes
  • 2 in conversation