Hello!
I am trying to figure out how to find the average of a value based off a range of time, specifically two weeks. Sample data is below
data test;
input ID date :yymmdd10. value;
format date yymmdd10.;
datalines;
1 2020-04-01 110
1 2020-04-02 120
1 2020-04-03 130
1 2020-04-04 110
1 2020-04-05 110
1 2020-04-06 115
1 2020-04-07 120
1 2020-04-08 140
1 2020-04-09 130
1 2020-04-10 110
1 2020-04-11 120
1 2020-04-12 130
1 2020-04-13 120
1 2020-04-14 130
1 2020-04-15 140
1 2020-04-16 135
1 2020-04-17 135
1 2020-04-18 130
1 2020-04-19 150
1 2020-04-20 155
1 2020-04-21 140
1 2020-04-22 145
1 2020-04-23 150
1 2020-04-24 150
1 2020-04-25 155
1 2020-04-26 145
1 2020-04-27 150
1 2020-04-28 160
1 2020-04-29 165
1 2020-04-30 165
;
run;
The dataset I am actually working with includes many more observations, from September 2019 to July 2020, but this is just a subset. I would like to find the average of the 'value' variable across a timeframe of two weeks, so Bimonthly essentially. Any idea on how to perform this? Thanks!