-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssignment2_Walmart_Forecasting.sas
122 lines (85 loc) · 2.96 KB
/
Assignment2_Walmart_Forecasting.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
ods pdf;
PROC IMPORT OUT= WORK.Walmart_Forecasting
DATAFILE= "C:\Users\sanja\Google Drive\2ndSem\BIA672_Marketi
ngAnalytics_KashaDehnad\RAW-Data\WallMart_store_sales.csv"
DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
data Store1_Dept1 Walmart5_rest;
*keep store dept date weekly_sales isholiday;
set Walmart_Forecasting;
if store = 1 and dept = 1 then output Store1_Dept1;
else output Walmart5_rest;
run;
proc sgplot data=Store1_Dept1;
series x=Date y=Weekly_Sales / markers;
run;
proc forecast data=Store1_Dept1
method=expo lead=12 trend=1
out=out_expo_walmart outfull outresid outest=est_expo_walmart;
id Date;
var Weekly_Sales;
run;
proc sgplot data=out_expo_walmart;
where _type_="RESIDUAL" and Date>10/26/12;
needle x=Date y=Weekly_Sales / markers markerattrs=(symbol=circlefilled);
run;
proc sgplot data=out_expo_walmart;
series x=date y=Weekly_Sales / group=_type_ lineattrs=(pattern=1);
where _type_ ^= 'RESIDUAL' and Date>10/26/12;
run;
proc forecast data=Store1_Dept1
method=expo lead=12 trend=2
out=out_doubleexpo_walmart outfull outresid outest=est_expo_walmart;
id Date;
var Weekly_Sales;
run;
proc sgplot data=out_doubleexpo_walmart;
where _type_="RESIDUAL" and Date>10/26/12;
needle x=Date y=Weekly_Sales / markers markerattrs=(symbol=circlefilled);
run;
proc sgplot data=out_doubleexpo_walmart;
series x=date y=Weekly_Sales / group=_type_ lineattrs=(pattern=1);
where _type_ ^= 'RESIDUAL' and Date>10/26/12;
run;
proc forecast data=Store1_Dept1
method=winters seasons=4 lead=4
out=out_winters_walmart4 outfull outresid outest=est_walmart4;
id date;
var weekly_sales;
run;
*;
title1 "Sales of Passenger Cars";
title2 'Plot of Forecast from WINTERS Method';
proc sgplot data=out_winters_walmart4;
series x=date y=weekly_sales / group=_type_ lineattrs=(pattern=1);
where _type_ ^= 'RESIDUAL' and Date>10/26/12;
run;
proc forecast data=Store1_Dept1
method=winters seasons=8 lead=8
out=out_winters_walmart8 outfull outresid outest=est_walmart8;
id date;
var weekly_sales;
run;
*;
title1 "Sales of Passenger Cars";
title2 'Plot of Forecast from WINTERS Method';
proc sgplot data=out_winters_walmart8;
series x=date y=weekly_sales / group=_type_ lineattrs=(pattern=1);
where _type_ ^= 'RESIDUAL' and Date>10/26/12;
run;
proc forecast data=Store1_Dept1
method=winters seasons=13 lead=13
out=out_winters_walmart13 outfull outresid outest=est_walmart13;
id date;
var weekly_sales;
run;
*;
title1 "Sales of Passenger Cars";
title2 'Plot of Forecast from WINTERS Method';
proc sgplot data=out_winters_walmart13;
series x=date y=weekly_sales / group=_type_ lineattrs=(pattern=1);
where _type_ ^= 'RESIDUAL' and Date>10/26/12;
run;
ods pdf close;