BookmarkSubscribeRSS Feed
chemicalab
Fluorite | Level 6

Hi all,

I have a time series containg data over a stretch of 52 weeks. My goal is the following : to smooth with an equallly weighted moving average the observations were no promotion (kinda looking for outliers) is present in order to use this new series for model setup and forecasting. Does proc expand provide with such an option? cause if i am not mistaken i have to use the whole series as an input or maybe i havent crasped the concept of proc expand in its whole.

Kind regards

4 REPLIES 4
Reeza
Super User

I'm not fully sure what you're after, but most proc's in SAS allow a WHERE clause so you can specify what data the procedure uses.

Then you can recombine your data after you have a smoothed dataset.

chemicalab
Fluorite | Level 6

Yes , i am aware of that , i was just looking for an option where i wouldnt have to subset my dataset to those cases

udo_sas
SAS Employee

Hello -

I will give it a try, but I'm pretty sure I'm missing the mark - in this example I'm using EXPAND to "smooth a pattern" with a moving average window of 5 observations:

proc expand data=sashelp.air out=out method=none;

     id date;

     convert air=predict / transformout=(movave 5);

run;

data plot;

set sashelp.air out;

by date;

run;

proc sgplot data=out;

series x=date y=air;

series x=date y=predict;

run;

It would be very helpful if you could an example (how does the data look like now? How would you like the results to look like?).

Thanks,

Udo

chemicalab
Fluorite | Level 6

Thnx Udo i used your approach , modified a bit and it worked , thank you for the clarification

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 934 views
  • 0 likes
  • 3 in conversation