Hi SAS forecasting experts,
This time I came across the problem of using weekly data in a VAR model for forecasting. I have two-year weekly sales and marketing campaign data (RAQ) and want to use VAR to run forecast. However, the sales always have spikes at the end of month. As the data is weekly, the end of month can be the fourth week of a month or (the beginning of) the fifth week. So, my question is: how to do such month-month seasonal adjustment using weekly data in order to use the seasonally adjusted data in the VAR model?
The sample data is attached. Both the sales and the campaign activities are in logarithm form.
Thank you!
week | year | lsales | lcampaign |
0 | 2013 | 9.511629 | 10.94447 |
1 | 2013 | 9.73074 | 11.19503 |
2 | 2013 | 9.820323 | 11.26294 |
3 | 2013 | 9.888374 | 11.30585 |
4 | 2013 | 10.02167 | 11.24355 |
5 | 2013 | 9.699779 | 11.14156 |
6 | 2013 | 9.985759 | 11.21244 |
7 | 2013 | 10.14345 | 11.28749 |
8 | 2013 | 10.35993 | 11.2146 |
9 | 2013 | 9.789815 | 11.09255 |
10 | 2013 | 9.98516 | 11.09909 |
11 | 2013 | 10.05651 | 11.18147 |
12 | 2013 | 10.36945 | 11.18582 |
13 | 2013 | 9.878631 | 11.0726 |
14 | 2013 | 9.971707 | 11.05936 |
15 | 2013 | 10.0575 | 11.08756 |
16 | 2013 | 10.20233 | 11.14399 |
17 | 2013 | 10.14624 | 11.02723 |
18 | 2013 | 9.879041 | 10.97432 |
19 | 2013 | 10.00406 | 11.02241 |
20 | 2013 | 10.25857 | 11.1648 |
21 | 2013 | 10.42955 | 11.14669 |
22 | 2013 | 9.923535 | 11.04971 |
23 | 2013 | 10.04329 | 11.06462 |
24 | 2013 | 10.13321 | 11.11524 |
25 | 2013 | 10.39035 | 11.20462 |
26 | 2013 | 10.05617 | 11.14541 |
27 | 2013 | 10.06216 | 11.11842 |
28 | 2013 | 10.08168 | 11.21829 |
29 | 2013 | 10.19347 | 11.32347 |
30 | 2013 | 10.2509 | 11.29164 |
31 | 2013 | 10.021 | 11.26334 |
32 | 2013 | 10.04863 | 11.25205 |
33 | 2013 | 10.12415 | 11.26457 |
34 | 2013 | 10.42899 | 11.28143 |
35 | 2013 | 9.972874 | 11.12966 |
36 | 2013 | 9.811756 | 11.10172 |
37 | 2013 | 9.864227 | 11.10297 |
38 | 2013 | 10.0174 | 11.06164 |
39 | 2013 | 9.921278 | 11.02241 |
40 | 2013 | 9.79568 | 11.00686 |
41 | 2013 | 9.940253 | 11.05972 |
42 | 2013 | 10.05595 | 11.11215 |
43 | 2013 | 10.11131 | 11.04937 |
44 | 2013 | 9.603395 | 10.9504 |
45 | 2013 | 9.723523 | 11.00896 |
46 | 2013 | 9.863915 | 11.05559 |
47 | 2013 | 10.20814 | 11.08708 |
48 | 2013 | 9.721606 | 10.91369 |
49 | 2013 | 9.669788 | 10.92228 |
50 | 2013 | 9.873131 | 10.93519 |
51 | 2013 | 9.990811 | 11.00627 |
52 | 2013 | 9.651366 | 10.49255 |
0 | 2014 | 9.381432 | 10.50381 |
1 | 2014 | 9.392162 | 11.03046 |
2 | 2014 | 9.713174 | 11.07163 |
3 | 2014 | 9.809342 | 11.12891 |
4 | 2014 | 9.986955 | 11.10241 |
5 | 2014 | 9.488502 | 11.0561 |
6 | 2014 | 9.833226 | 11.19188 |
7 | 2014 | 10.16574 | 11.24522 |
8 | 2014 | 10.4304 | 11.23107 |
9 | 2014 | 9.709357 | 11.12648 |
10 | 2014 | 9.98815 | 11.13966 |
11 | 2014 | 10.07631 | 11.19915 |
12 | 2014 | 10.21841 | 11.26174 |
13 | 2014 | 10.09005 | 11.09156 |
14 | 2014 | 9.982576 | 11.03743 |
15 | 2014 | 10.05959 | 11.12678 |
16 | 2014 | 10.14471 | 11.16423 |
17 | 2014 | 10.2376 | 11.08667 |
18 | 2014 | 9.961143 | 11.03373 |
19 | 2014 | 10.05651 | 11.13076 |
20 | 2014 | 10.17329 | 11.17912 |
21 | 2014 | 10.3772 | 11.13428 |
22 | 2014 | 9.946595 | 11.02451 |
23 | 2014 | 10.01864 | 11.04596 |
24 | 2014 | 10.09448 | 11.07414 |
25 | 2014 | 10.27215 | 11.15696 |
26 | 2014 | 10.21365 | 11.11531 |
27 | 2014 | 10.19388 | 11.16723 |
28 | 2014 | 10.08997 | 11.1838 |
29 | 2014 | 10.05651 | 11.17566 |
30 | 2014 | 10.19096 | 11.1527 |
31 | 2014 | 9.795457 | 11.072 |
32 | 2014 | 9.921769 | 11.09712 |
33 | 2014 | 10.07786 | 11.21036 |
34 | 2014 | 10.41085 | 11.3168 |
35 | 2014 | 10.05199 | 11.20929 |
36 | 2014 | 9.903837 | 11.1398 |
37 | 2014 | 9.965711 | 11.15681 |
38 | 2014 | 10.09237 | 11.18805 |
39 | 2014 | 10.07933 | 11.15161 |
40 | 2014 | 9.766636 | 11.13017 |
41 | 2014 | 9.85692 | 11.15869 |
42 | 2014 | 9.906732 | 11.16284 |
43 | 2014 | 10.16908 | 11.17224 |
44 | 2014 | 9.640368 | 11.14215 |
45 | 2014 | 9.805875 | 11.21039 |
46 | 2014 | 9.870758 | 11.32554 |
47 | 2014 | 10.12579 | 11.27662 |
48 | 2014 | 9.86277 | 11.19193 |
49 | 2014 | 9.844268 | 11.13488 |
50 | 2014 | 10.06373 | 11.17643 |
51 | 2014 | 10.07643 | 11.15661 |
52 | 2014 | 10.1118 | 10.81565 |
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.