Guest User

Untitled

a guest
Jan 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. library(ISLR)
  2. auto_fit3 <- lm(mpg~(.-name)*(.-name), data = Auto)
  3. summary(auto_fit3)
  4. # acceleration:origin seems to be stat. significant in full model, let's
  5. # check how the things are in model with only these two
  6. auto_fit4 <- lm(mpg~acceleration*origin, data = Auto)
  7. summary(auto_fit4)
  8.  
  9. Residuals:
  10. Min 1Q Median 3Q Max
  11. -7.6303 -1.4481 0.0596 1.2739 11.1386
  12.  
  13. Coefficients:
  14. Estimate Std. Error t value Pr(>|t|)
  15. (Intercept) 3.548e+01 5.314e+01 0.668 0.50475
  16. cylinders 6.989e+00 8.248e+00 0.847 0.39738
  17. displacement -4.785e-01 1.894e-01 -2.527 0.01192 *
  18. horsepower 5.034e-01 3.470e-01 1.451 0.14769
  19. weight 4.133e-03 1.759e-02 0.235 0.81442
  20. acceleration -5.859e+00 2.174e+00 -2.696 0.00735 **
  21. year 6.974e-01 6.097e-01 1.144 0.25340
  22. origin -2.090e+01 7.097e+00 -2.944 0.00345 **
  23. cylinders:displacement -3.383e-03 6.455e-03 -0.524 0.60051
  24. cylinders:horsepower 1.161e-02 2.420e-02 0.480 0.63157
  25. cylinders:weight 3.575e-04 8.955e-04 0.399 0.69000
  26. cylinders:acceleration 2.779e-01 1.664e-01 1.670 0.09584 .
  27. cylinders:year -1.741e-01 9.714e-02 -1.793 0.07389 .
  28. cylinders:origin 4.022e-01 4.926e-01 0.816 0.41482
  29. displacement:horsepower -8.491e-05 2.885e-04 -0.294 0.76867
  30. displacement:weight 2.472e-05 1.470e-05 1.682 0.09342 .
  31. displacement:acceleration -3.479e-03 3.342e-03 -1.041 0.29853
  32. displacement:year 5.934e-03 2.391e-03 2.482 0.01352 *
  33. displacement:origin 2.398e-02 1.947e-02 1.232 0.21875
  34. horsepower:weight -1.968e-05 2.924e-05 -0.673 0.50124
  35. horsepower:acceleration -7.213e-03 3.719e-03 -1.939 0.05325 .
  36. horsepower:year -5.838e-03 3.938e-03 -1.482 0.13916
  37. horsepower:origin 2.233e-03 2.930e-02 0.076 0.93931
  38. weight:acceleration 2.346e-04 2.289e-04 1.025 0.30596
  39. weight:year -2.245e-04 2.127e-04 -1.056 0.29182
  40. weight:origin -5.789e-04 1.591e-03 -0.364 0.71623
  41. acceleration:year 5.562e-02 2.558e-02 2.174 0.03033 *
  42. acceleration:origin 4.583e-01 1.567e-01 2.926 0.00365 **
  43. year:origin 1.393e-01 7.399e-02 1.882 0.06062 .
  44. ---
  45. Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  46.  
  47. Residual standard error: 2.695 on 363 degrees of freedom
  48. Multiple R-squared: 0.8893, Adjusted R-squared: 0.8808
  49. F-statistic: 104.2 on 28 and 363 DF, p-value: < 2.2e-16
Add Comment
Please, Sign In to add comment