Hello, i have a data, and for every day i want to create time Moving window, and then to process all windows. at the end, i will keep only one row for big window and there will be some statistics of every little windows.
moving window includes two big windows(every one is 30 minutes, of course it can be any number) and every one of them include 3 little windows(every one can be different number but total is 30 minutes)
for example my window is 1 hour, so one window is my sample window is 30 minutes, and then the second window (predicted window) is too 30 minutes. for every window i have to know their id(i have to create id)
what i get :
window : 08:00 - 09:00
sample window : 08:00-08:30
sample_window1 :08:00-08:05, sample_window2 : 08:05-08:15, sample_window3 : 08:5-08:30
predicted window : 08:30-09:00
predicted_window1 :08:30-08:40, predicted_window2 : 08:40-08:50, predicted_window3 : 08:50-09:00
then i have to create interval, for example 10 minutes, and create windows again and so on...
window : 08:10 - 09:10
sample window : 08:10-08:40
sample_window1 :08:10-08:15, sample_window2 : 08:15-08:25, sample_window3 : 08:25-08:40
predicted window : 08:40-09:10
predicted_window1 :08:40-08:50, predicted_window2 : 08:50-09:00, predicted_window3 : 09:00-09:10
off course all times and intervals are macro variables.
my data example :
time date
08:00 26/10/15
08:01 26/10/15
08:10 26/10/15
08:15 26/10/15
08:20 26/10/15
08:29 26/10/15
08:37 26/10/15
08:38 26/10/15
08:47 26/10/15
08:54 26/10/15
08:58 26/10/15
.....
How can i do it? thank you!!!!
yes, i have ETS. i know about the proc expand, but how i can create in proc expand moving window?
i predicted windows i want only to find the last price and first price, and in the sample window, i want to find some simple statistics, such as mean, total volume... then i want to present it as one row, i.e every big window(in my example 1 hour) .
thank you for your help
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.