
##
## Call:
## lm(formula = Weekly_Sales ~ . - Date, data = trainlm)
##
## Residuals:
## Min 1Q Median 3Q Max
## -525633 -68991 -12509 39748 1846111
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1151243.2 272157.8 4.230 2.38e-05 ***
## Store2 345185.7 23131.9 14.923 < 2e-16 ***
## Store3 -1182103.4 23860.8 -49.542 < 2e-16 ***
## Store4 780139.7 113852.5 6.852 8.26e-12 ***
## Store5 -1275756.5 24041.0 -53.066 < 2e-16 ***
## Store6 -31479.8 23051.0 -1.366 0.172116
## Store7 -916670.9 34857.1 -26.298 < 2e-16 ***
## Store8 -717191.8 24207.0 -29.627 < 2e-16 ***
## Store9 -1062818.7 24423.8 -43.516 < 2e-16 ***
## Store10 673025.1 110260.5 6.104 1.12e-09 ***
## Store11 -220807.2 23391.9 -9.439 < 2e-16 ***
## Store12 -117652.0 103278.6 -1.139 0.254693
## Store13 701813.5 111822.7 6.276 3.80e-10 ***
## Store14 611529.2 42897.5 14.256 < 2e-16 ***
## Store15 -653568.8 103520.8 -6.313 2.99e-10 ***
## Store16 -1008393.6 38108.0 -26.461 < 2e-16 ***
## Store17 -421318.3 112843.5 -3.734 0.000191 ***
## Store18 -166822.5 101202.5 -1.648 0.099340 .
## Store19 179028.9 103426.0 1.731 0.083523 .
## Store20 548748.8 25303.3 21.687 < 2e-16 ***
## Store21 -812656.4 23488.5 -34.598 < 2e-16 ***
## Store22 -263125.9 97717.3 -2.693 0.007113 **
## Store23 42260.6 110440.2 0.383 0.701993
## Store24 106935.2 102340.9 1.045 0.296129
## Store25 -848898.6 24922.1 -34.062 < 2e-16 ***
## Store26 -281187.6 103072.5 -2.728 0.006396 **
## Store27 490291.0 98773.4 4.964 7.17e-07 ***
## Store28 199456.1 103261.5 1.932 0.053476 .
## Store29 -692860.5 99293.6 -6.978 3.44e-12 ***
## Store30 -1125380.1 22514.9 -49.984 < 2e-16 ***
## Store31 -174307.3 23075.9 -7.554 5.10e-14 ***
## Store32 -317341.0 34839.1 -9.109 < 2e-16 ***
## Store33 -956315.0 109823.6 -8.708 < 2e-16 ***
## Store34 -253007.9 105592.6 -2.396 0.016612 *
## Store35 -346454.1 96218.2 -3.601 0.000321 ***
## Store36 -1190644.6 23216.4 -51.285 < 2e-16 ***
## Store37 -1032651.1 22870.9 -45.151 < 2e-16 ***
## Store38 -742825.5 103466.0 -7.179 8.16e-13 ***
## Store39 -103994.2 22905.8 -4.540 5.77e-06 ***
## Store40 -381538.0 110391.8 -3.456 0.000553 ***
## Store41 -242781.0 37135.2 -6.538 6.94e-11 ***
## Store42 -670390.8 110417.9 -6.071 1.37e-09 ***
## Store43 -857609.3 25877.4 -33.141 < 2e-16 ***
## Store44 -987424.4 112316.8 -8.791 < 2e-16 ***
## Store45 -654165.3 42482.5 -15.398 < 2e-16 ***
## Holiday_Flag1 62271.6 9505.0 6.551 6.34e-11 ***
## Temperature -771.8 157.8 -4.892 1.03e-06 ***
## Fuel_Price -41411.1 8552.7 -4.842 1.33e-06 ***
## CPI 3500.3 1232.7 2.839 0.004539 **
## Unemployment -20854.4 5128.0 -4.067 4.85e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 160600 on 4478 degrees of freedom
## Multiple R-squared: 0.9197, Adjusted R-squared: 0.9188
## F-statistic: 1047 on 49 and 4478 DF, p-value: < 2.2e-16
## Store Date Weekly_Sales Holiday_Flag
## 15 : 52 Length:1907 Min. : 215359 0:1777
## 18 : 52 Class :character 1st Qu.: 555466 1: 130
## 3 : 51 Mode :character Median : 972374
## 26 : 51 Mean :1051602
## 40 : 51 3rd Qu.:1414336
## 21 : 50 Max. :3676389
## (Other):1600
## Temperature Fuel_Price CPI Unemployment
## Min. : 5.54 Min. :2.514 Min. :126.1 Min. : 3.879
## 1st Qu.: 47.43 1st Qu.:2.909 1st Qu.:131.8 1st Qu.: 6.925
## Median : 62.27 Median :3.417 Median :182.0 Median : 7.907
## Mean : 60.36 Mean :3.345 Mean :171.1 Mean : 7.997
## 3rd Qu.: 74.58 3rd Qu.:3.722 3rd Qu.:212.6 3rd Qu.: 8.622
## Max. :100.07 Max. :4.468 Max. :227.2 Max. :14.313
##
## sales_predicted res2 tot2
## Min. : 231680 Min. :8.400e+01 Min. :1.920e+04
## 1st Qu.: 562480 1st Qu.:6.043e+08 1st Qu.:4.058e+10
## Median : 977351 Median :2.747e+09 Median :2.024e+11
## Mean :1052345 Mean :2.559e+10 Mean :3.204e+11
## 3rd Qu.:1424534 3rd Qu.:1.138e+10 3rd Qu.:4.430e+11
## Max. :2189644 Max. :2.424e+12 Max. :6.890e+12
##
1. Weekly sales increase when CPI increase
2. Weekly sales decrease when unemployment is high
3. When it is cold outside, sales decrease
r2 is 0.9, which means the model is statistically significant