## Загрузка требуемого пакета: ggplot2
## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2
## Загрузка требуемого пакета: zoo
## 
## Присоединяю пакет: 'zoo'
## Следующие объекты скрыты от 'package:base':
## 
##     as.Date, as.Date.numeric
##      Sales            Price        Advertising      ShelveLoc  
##  Min.   : 0.000   Min.   : 24.0   Min.   : 0.000   Bad   : 96  
##  1st Qu.: 5.390   1st Qu.:100.0   1st Qu.: 0.000   Good  : 85  
##  Median : 7.490   Median :117.0   Median : 5.000   Medium:219  
##  Mean   : 7.496   Mean   :115.8   Mean   : 6.635               
##  3rd Qu.: 9.320   3rd Qu.:131.0   3rd Qu.:12.000               
##  Max.   :16.270   Max.   :191.0   Max.   :29.000
## Warning in ggmatrix_gtable(x, ...): Please use the 'progress' parameter in
## your ggmatrix-like function call. See ?ggmatrix_progress for a few examples.
## ggmatrix_gtable 'progress' and 'progress_format' will soon be deprecated.TRUE
## 
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## 
## 
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## 
## 
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

## Warning in ggmatrix_gtable(x, ...): Please use the 'progress' parameter in
## your ggmatrix-like function call. See ?ggmatrix_progress for a few examples.
## ggmatrix_gtable 'progress' and 'progress_format' will soon be deprecated.TRUE
## 
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

## 
## Call:
## lm(formula = Sales ~ . + Price:ShelveLoc + Advertising:ShelveLoc, 
##     data = df.train)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.5311 -1.0824 -0.0192  1.1388  4.2740 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 11.3002861  0.9483076  11.916  < 2e-16 ***
## Price                       -0.0546137  0.0079913  -6.834 3.98e-11 ***
## Advertising                  0.0860625  0.0301535   2.854  0.00459 ** 
## ShelveLocGood                5.9178585  1.3857589   4.270 2.55e-05 ***
## ShelveLocMedium              1.5300896  1.1908552   1.285  0.19974    
## Price:ShelveLocGood         -0.0098768  0.0114409  -0.863  0.38860    
## Price:ShelveLocMedium        0.0004187  0.0100099   0.042  0.96666    
## Advertising:ShelveLocGood    0.0012540  0.0424810   0.030  0.97647    
## Advertising:ShelveLocMedium  0.0238116  0.0362447   0.657  0.51166    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.754 on 331 degrees of freedom
## Multiple R-squared:  0.6141, Adjusted R-squared:  0.6048 
## F-statistic: 65.85 on 8 and 331 DF,  p-value: < 2.2e-16
## 
## Call:
## lm(formula = Sales ~ . + Advertising:ShelveLoc, data = df.train)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.5477 -1.0465  0.0038  1.1280  4.2140 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 11.567499   0.537682  21.514  < 2e-16 ***
## Price                       -0.056952   0.004143 -13.745  < 2e-16 ***
## Advertising                  0.086165   0.030113   2.861  0.00448 ** 
## ShelveLocGood                4.761605   0.391984  12.147  < 2e-16 ***
## ShelveLocMedium              1.581912   0.311196   5.083  6.2e-07 ***
## Advertising:ShelveLocGood    0.001861   0.042422   0.044  0.96503    
## Advertising:ShelveLocMedium  0.023871   0.036195   0.660  0.51002    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.751 on 333 degrees of freedom
## Multiple R-squared:  0.6128, Adjusted R-squared:  0.6058 
## F-statistic: 87.83 on 6 and 333 DF,  p-value: < 2.2e-16
## 
## Call:
## lm(formula = Sales ~ Price + Advertising + ShelveLoc, data = df.train)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.7098 -1.0930  0.0193  1.1849  4.1478 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     11.491113   0.516860  22.233  < 2e-16 ***
## Price           -0.056915   0.004134 -13.767  < 2e-16 ***
## Advertising      0.099194   0.014552   6.816 4.35e-11 ***
## ShelveLocGood    4.753523   0.282698  16.815  < 2e-16 ***
## ShelveLocMedium  1.721109   0.231175   7.445 8.27e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.748 on 335 degrees of freedom
## Multiple R-squared:  0.6121, Adjusted R-squared:  0.6074 
## F-statistic: 132.1 on 4 and 335 DF,  p-value: < 2.2e-16
## 
## Call:
## lm(formula = Sales ~ Price + ShelveLoc, data = df.train)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4731 -1.3552 -0.0733  1.2653  5.1448 
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     12.023705   0.544391  22.087  < 2e-16 ***
## Price           -0.056765   0.004405 -12.887  < 2e-16 ***
## ShelveLocGood    4.915635   0.300150  16.377  < 2e-16 ***
## ShelveLocMedium  1.784519   0.246119   7.251 2.88e-12 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.862 on 336 degrees of freedom
## Multiple R-squared:  0.5583, Adjusted R-squared:  0.5543 
## F-statistic: 141.5 on 3 and 336 DF,  p-value: < 2.2e-16
## 
## Call:
## lm(formula = Sales ~ Price + ShelveLoc + Price:ShelveLoc, data = df.train)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4781 -1.3598 -0.0816  1.2427  4.9877 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           11.7470469  0.9943558  11.814  < 2e-16 ***
## Price                 -0.0543499  0.0084953  -6.398 5.33e-10 ***
## ShelveLocGood          6.1701700  1.4415001   4.280 2.44e-05 ***
## ShelveLocMedium        1.6956329  1.2493941   1.357    0.176    
## Price:ShelveLocGood   -0.0107554  0.0121608  -0.884    0.377    
## Price:ShelveLocMedium  0.0007331  0.0106409   0.069    0.945    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.864 on 334 degrees of freedom
## Multiple R-squared:  0.5599, Adjusted R-squared:  0.5533 
## F-statistic: 84.98 on 5 and 334 DF,  p-value: < 2.2e-16
## 
##  studentized Breusch-Pagan test
## 
## data:  model.4
## BP = 0.35539, df = 3, p-value = 0.9493
## 
##  Durbin-Watson test
## 
## data:  model.4
## DW = 2.0934, p-value = 0.805
## alternative hypothesis: true autocorrelation is greater than 0