First Programme on Multiple Linear Regression
getwd()
## [1] "C:/Users/yogesh.thimmegowda/Desktop/SKY/R MarkDown"
setwd("C://Users//yogesh.thimmegowda//Desktop")
car<- read.csv("C://Users//yogesh.thimmegowda//Desktop//Cars.csv")
attach(car)
plot(car)

colnames(car)
## [1] "HP" "MPG" "VOL" "SP" "WT"
# Correlation coefficient value for Waist and Addipose tissue
cor(car)
## HP MPG VOL SP WT
## HP 1.00000000 -0.7250383 0.07745947 0.9738481 0.07651307
## MPG -0.72503835 1.0000000 -0.52905658 -0.6871246 -0.52675909
## VOL 0.07745947 -0.5290566 1.00000000 0.1021700 0.99920308
## SP 0.97384807 -0.6871246 0.10217001 1.0000000 0.10243919
## WT 0.07651307 -0.5267591 0.99920308 0.1024392 1.00000000
model1 <- lm(MPG~HP+VOL+SP+WT)
summary(model1)
##
## Call:
## lm(formula = MPG ~ HP + VOL + SP + WT)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.6320 -2.9944 -0.3705 2.2149 15.6179
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 30.67734 14.90030 2.059 0.0429 *
## HP -0.20544 0.03922 -5.239 1.4e-06 ***
## VOL -0.33605 0.56864 -0.591 0.5563
## SP 0.39563 0.15826 2.500 0.0146 *
## WT 0.40057 1.69346 0.237 0.8136
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.488 on 76 degrees of freedom
## Multiple R-squared: 0.7705, Adjusted R-squared: 0.7585
## F-statistic: 63.8 on 4 and 76 DF, p-value: < 2.2e-16
confint(model1,level = 0.95)
## 2.5 % 97.5 %
## (Intercept) 1.00082418 60.3538475
## HP -0.28354972 -0.1273377
## VOL -1.46860042 0.7964987
## SP 0.08042811 0.7108257
## WT -2.97224920 3.7733974
predict(model1,interval="predict")
## Warning in predict.lm(model1, interval = "predict"): predictions on current data refer to _future_ responses
## fit lwr upr
## 1 43.44193 34.274218 52.60965
## 2 42.38879 33.254591 51.52299
## 3 42.27934 33.211022 51.34766
## 4 42.53836 33.317086 51.75963
## 5 42.17265 33.059114 51.28618
## 6 43.02062 33.818855 52.22238
## 7 42.32536 33.240666 51.41006
## 8 48.07622 38.658257 57.49418
## 9 48.28120 38.791753 57.77065
## 10 40.79123 31.714031 49.86843
## 11 41.52153 32.455495 50.58757
## 12 47.80957 38.436508 57.18263
## 13 39.95980 30.681072 49.23853
## 14 41.52758 32.457283 50.59788
## 15 41.76632 32.687860 50.84479
## 16 41.61814 32.450406 50.78588
## 17 41.15094 32.034640 50.26724
## 18 47.98606 38.670765 57.30135
## 19 41.30861 32.245861 50.37136
## 20 37.87128 28.713868 47.02869
## 21 38.57706 29.469329 47.68480
## 22 37.35200 28.270135 46.43386
## 23 37.89770 28.621309 47.17410
## 24 39.56251 30.469134 48.65589
## 25 39.93381 30.768690 49.09892
## 26 46.73871 37.479644 55.99777
## 27 35.48166 26.122543 44.84078
## 28 38.78153 29.648963 47.91409
## 29 38.24861 28.878005 47.61922
## 30 36.00285 26.859910 45.14580
## 31 34.84604 25.656609 44.03547
## 32 37.21630 28.190535 46.24207
## 33 37.13920 27.979458 46.29894
## 34 34.82541 25.672468 43.97836
## 35 37.22361 28.069683 46.37755
## 36 37.53950 28.494280 46.58472
## 37 39.27145 30.251151 48.29175
## 38 38.24220 29.189120 47.29528
## 39 38.54286 29.363201 47.72253
## 40 35.93917 26.847189 45.03116
## 41 34.21298 25.161570 43.26438
## 42 35.36313 26.330370 44.39590
## 43 37.50473 28.408387 46.60108
## 44 38.07998 28.930688 47.22928
## 45 35.79652 26.678460 44.91457
## 46 36.26134 27.251668 45.27101
## 47 34.21826 25.198461 43.23807
## 48 35.59393 26.586627 44.60124
## 49 36.91805 27.828104 46.00800
## 50 33.31108 24.209878 42.41229
## 51 33.21313 24.175408 42.25086
## 52 33.30236 24.209824 42.39491
## 53 29.19865 19.988412 38.40889
## 54 27.52359 18.144852 36.90232
## 55 28.32071 19.217368 37.42406
## 56 28.56723 19.430804 37.70365
## 57 35.81584 26.627578 45.00409
## 58 33.02108 23.890295 42.15187
## 59 35.37335 26.246515 44.50018
## 60 32.29910 23.227414 41.37078
## 61 29.87686 20.762266 38.99145
## 62 28.76094 19.564145 37.95773
## 63 25.14188 15.997670 34.28610
## 64 26.47041 17.357606 35.58321
## 65 25.97652 16.841657 35.11138
## 66 36.35652 26.847748 45.86530
## 67 26.09759 16.904841 35.29034
## 68 23.64162 14.468251 32.81498
## 69 24.39887 15.306201 33.49154
## 70 20.21195 10.732116 29.69179
## 71 27.80846 17.925611 37.69132
## 72 22.44207 13.081963 31.80217
## 73 23.07668 13.907311 32.24604
## 74 18.71731 9.253390 28.18124
## 75 23.84935 14.571500 33.12719
## 76 21.07461 11.842895 30.30633
## 77 21.28210 11.283302 31.28089
## 78 17.89905 8.640217 27.15788
## 79 26.13645 16.375785 35.89712
## 80 12.31661 2.702601 21.93062
## 81 15.55948 5.764723 25.35424
model.carV<-lm(MPG~VOL)
summary(model.carV) # Volume became significant
##
## Call:
## lm(formula = MPG ~ VOL)
##
## Residuals:
## Min 1Q Median 3Q Max
## -25.3074 -5.2026 0.1902 5.4536 17.1632
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 55.81709 3.95696 14.106 < 2e-16 ***
## VOL -0.21662 0.03909 -5.541 3.82e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 7.798 on 79 degrees of freedom
## Multiple R-squared: 0.2799, Adjusted R-squared: 0.2708
## F-statistic: 30.71 on 1 and 79 DF, p-value: 3.823e-07
# Prediction based on only Weight
model.carW<-lm(MPG~WT)
summary(model.carW) # Weight became significant
##
## Call:
## lm(formula = MPG ~ WT)
##
## Residuals:
## Min 1Q Median 3Q Max
## -25.3933 -5.4377 0.2738 5.2951 16.9351
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 55.2296 3.8761 14.249 < 2e-16 ***
## WT -0.6420 0.1165 -5.508 4.38e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 7.811 on 79 degrees of freedom
## Multiple R-squared: 0.2775, Adjusted R-squared: 0.2683
## F-statistic: 30.34 on 1 and 79 DF, p-value: 4.383e-07
# Prediction based on Volume and Weight
model.carVW<-lm(MPG~VOL+WT)
summary(model.carVW) # Both became Insignificant
##
## Call:
## lm(formula = MPG ~ VOL + WT)
##
## Residuals:
## Min 1Q Median 3Q Max
## -24.9939 -4.9460 0.0028 5.3905 17.6972
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 56.8847 4.5342 12.55 <2e-16 ***
## VOL -0.6983 0.9841 -0.71 0.480
## WT 1.4349 2.9291 0.49 0.626
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 7.835 on 78 degrees of freedom
## Multiple R-squared: 0.2821, Adjusted R-squared: 0.2637
## F-statistic: 15.33 on 2 and 78 DF, p-value: 2.434e-06
influence.measures(model1)
## Influence measures of
## lm(formula = MPG ~ HP + VOL + SP + WT) :
##
## dfb.1_ dfb.HP dfb.VOL dfb.SP dfb.WT dffit cov.r
## 1 0.027438 -0.064490 0.34491 -1.06e-02 -0.348732 0.56724 0.774
## 2 0.130255 0.035945 -0.22541 -8.57e-02 0.224097 0.37945 0.913
## 3 0.090410 0.010673 -0.03970 -6.06e-02 0.038239 0.30826 0.896
## 4 -0.050842 -0.086513 -0.12604 7.38e-02 0.124908 0.19016 1.103
## 5 0.086150 0.014157 0.17799 -7.17e-02 -0.179572 0.39154 0.874
## 6 -0.038227 -0.068912 -0.09931 5.82e-02 0.097995 0.15449 1.108
## 7 0.106859 0.021234 -0.11741 -7.10e-02 0.116017 0.32649 0.901
## 8 -0.065348 -0.044642 -0.01492 5.30e-02 0.017852 -0.11238 1.193
## 9 -0.093081 -0.062806 0.05912 7.25e-02 -0.055744 -0.14161 1.213
## 10 -0.031771 -0.041975 -0.00857 3.74e-02 0.008142 0.06104 1.095
## 11 0.010849 -0.018542 -0.05995 5.55e-03 0.058726 0.12152 1.064
## 12 0.185184 0.269479 -0.24251 -2.60e-01 0.264240 -0.67399 0.909
## 13 0.029117 0.032757 0.01302 -3.20e-02 -0.012894 -0.04051 1.157
## 14 0.011711 -0.017970 -0.06396 4.99e-03 0.062745 0.12343 1.066
## 15 0.054751 0.013861 -0.07598 -3.43e-02 0.074656 0.16218 1.046
## 16 0.024610 -0.009612 -0.12416 -3.19e-03 0.122996 0.16212 1.092
## 17 -0.035743 -0.043967 0.04293 3.84e-02 -0.043618 0.07590 1.103
## 18 0.109967 0.222667 0.11288 -2.14e-01 -0.091298 -0.63072 0.889
## 19 -0.021167 -0.032416 -0.01180 2.75e-02 0.011223 0.05655 1.091
## 20 -0.034346 -0.035729 0.03309 3.34e-02 -0.033011 0.05350 1.120
## 21 0.005188 0.005631 -0.00310 -5.32e-03 0.003118 -0.00748 1.111
## 22 -0.009172 -0.027690 0.13117 1.91e-03 -0.128786 0.22782 0.997
## 23 -0.017641 -0.017551 0.02021 1.69e-02 -0.020237 0.02750 1.157
## 24 -0.000285 -0.007742 -0.02650 4.68e-03 0.026417 0.03917 1.104
## 25 0.048301 0.052463 -0.05565 -5.01e-02 0.056583 -0.08596 1.116
## 26 -0.082883 0.016880 0.01903 -2.74e-03 0.000512 -0.55124 0.897
## 27 -0.158459 -0.151772 0.14820 1.46e-01 -0.146183 0.22349 1.146
## 28 0.008111 0.010392 0.00955 -9.73e-03 -0.009524 -0.01799 1.117
## 29 0.323026 0.261335 -0.18454 -3.06e-01 0.187890 0.40784 1.073
## 30 0.013519 0.015781 0.01685 -1.53e-02 -0.017023 -0.02991 1.119
## 31 -0.037571 -0.035690 0.20218 1.77e-02 -0.198784 0.25885 1.053
## 32 0.026770 0.015135 -0.01523 -2.32e-02 0.015672 0.07028 1.072
## 33 0.020540 0.020495 -0.03504 -1.95e-02 0.035187 -0.04458 1.122
## 34 -0.030604 -0.035152 -0.04250 3.35e-02 0.043347 0.07496 1.115
## 35 0.010936 0.005937 0.09112 -1.56e-02 -0.090704 0.11893 1.103
## 36 -0.001573 -0.002726 0.00893 1.58e-03 -0.008936 0.01476 1.094
## 37 -0.009721 -0.002428 -0.00385 5.92e-03 0.004414 -0.04023 1.082
## 38 -0.017382 -0.004671 -0.08410 1.08e-02 0.086403 -0.15334 1.034
## 39 -0.083121 -0.045772 0.20544 5.21e-02 -0.203131 -0.24677 1.054
## 40 0.152467 0.151483 -0.02970 -1.63e-01 0.032106 -0.21212 1.019
## 41 0.002327 -0.000434 -0.01530 -1.92e-03 0.015947 0.03409 1.093
## 42 -0.001566 -0.000752 0.00332 1.27e-03 -0.003399 -0.00694 1.092
## 43 -0.039107 -0.016950 0.11655 2.19e-02 -0.115675 -0.14952 1.064
## 44 -0.027999 -0.021059 -0.11046 2.85e-02 0.111714 -0.14919 1.089
## 45 -0.000546 -0.000433 -0.00544 8.74e-04 0.005411 -0.00711 1.114
## 46 -0.009063 -0.002513 0.01889 5.52e-03 -0.018974 -0.04849 1.076
## 47 -0.002202 -0.002566 0.00112 1.93e-03 -0.000935 0.01048 1.088
## 48 -0.002937 -0.001218 0.00350 2.35e-03 -0.003634 -0.01517 1.084
## 49 0.159432 0.162450 -0.04698 -1.76e-01 0.051421 -0.25338 0.982
## 50 -0.101653 -0.090453 0.10473 9.35e-02 -0.105584 -0.16303 1.059
## 51 -0.081377 -0.076501 0.02529 7.95e-02 -0.026046 -0.12191 1.047
## 52 -0.099716 -0.089107 0.09732 9.21e-02 -0.098168 -0.15790 1.057
## 53 -0.002025 0.000521 0.01874 -9.74e-04 -0.018224 0.02530 1.138
## 54 0.153429 0.131520 0.09921 -1.56e-01 -0.100335 -0.23838 1.149
## 55 0.041217 0.031761 0.00259 -3.87e-02 -0.003279 -0.06524 1.102
## 56 0.014599 0.009917 -0.02015 -1.06e-02 0.019391 -0.03490 1.117
## 57 -0.235589 -0.211317 0.03237 2.27e-01 -0.032098 -0.26485 1.049
## 58 -0.048198 -0.054597 -0.11798 5.77e-02 0.117361 -0.16443 1.074
## 59 -0.186548 -0.171879 -0.06523 1.86e-01 0.065393 -0.25265 1.015
## 60 -0.037707 -0.039495 -0.05542 4.82e-02 0.052562 -0.13667 1.058
## 61 0.024059 0.018819 0.07541 -2.64e-02 -0.076628 -0.11635 1.089
## 62 -0.126961 -0.143815 -0.10712 1.49e-01 0.103065 -0.23796 1.069
## 63 -0.015838 -0.024985 0.02280 2.28e-02 -0.025296 -0.08159 1.111
## 64 -0.047739 -0.060306 0.04873 5.62e-02 -0.052219 -0.13562 1.080
## 65 -0.035161 -0.045946 0.06111 3.98e-02 -0.063646 -0.11608 1.097
## 66 0.190254 0.189618 0.08129 -1.71e-01 -0.089976 0.34353 1.169
## 67 -0.036320 -0.049478 0.12250 3.59e-02 -0.124629 -0.16959 1.099
## 68 0.006786 0.000503 -0.01561 -2.83e-03 0.014952 -0.02907 1.128
## 69 0.006291 -0.005653 -0.00920 9.04e-05 0.007847 -0.05551 1.101
## 70 -0.052619 -0.034244 -0.02289 5.05e-02 0.023153 0.09494 1.216
## 71 0.375081 0.225899 -0.20353 -4.17e-01 0.231060 -1.12358 1.033
## 72 -0.016888 -0.005558 0.04110 8.66e-03 -0.039847 0.05801 1.180
## 73 -0.001556 -0.000118 0.00260 6.18e-04 -0.002414 0.00678 1.127
## 74 0.006863 0.011133 -0.00131 -1.10e-02 0.002486 0.03234 1.215
## 75 -0.206329 -0.234704 0.04805 2.32e-01 -0.055962 -0.32060 1.068
## 76 -0.054797 -0.076780 0.05050 6.57e-02 -0.053946 -0.14193 1.124
## 77 0.214209 0.605131 -0.29653 -1.15e-01 0.240034 2.60978 0.431
## 78 -0.001403 0.020701 -0.00835 -4.72e-03 0.009157 0.08386 1.146
## 79 0.328332 0.443574 0.14545 -3.01e-01 -0.167508 0.97032 1.024
## 80 -0.249491 -0.044284 -0.14528 2.05e-01 0.150314 0.79955 1.013
## 81 -0.316601 -0.384383 -0.03288 3.44e-01 0.030357 -0.43138 1.273
## cook.d hat inf
## 1 6.05e-02 0.0520 *
## 2 2.80e-02 0.0443
## 3 1.85e-02 0.0293
## 4 7.28e-03 0.0643
## 5 2.96e-02 0.0396
## 6 4.81e-03 0.0598
## 7 2.07e-02 0.0330
## 8 2.56e-03 0.1102
## 9 4.06e-03 0.1271 *
## 10 7.54e-04 0.0313
## 11 2.97e-03 0.0288
## 12 8.73e-02 0.0997
## 13 3.32e-04 0.0776
## 14 3.07e-03 0.0298
## 15 5.27e-03 0.0316
## 16 5.29e-03 0.0520
## 17 1.17e-03 0.0402
## 18 7.63e-02 0.0861
## 19 6.47e-04 0.0281
## 20 5.80e-04 0.0496
## 21 1.13e-05 0.0383
## 22 1.03e-02 0.0324
## 23 1.53e-04 0.0771
## 24 3.11e-04 0.0350
## 25 1.49e-03 0.0514
## 26 5.86e-02 0.0731
## 27 1.01e-02 0.0964
## 28 6.56e-05 0.0440
## 29 3.30e-02 0.0991
## 30 1.81e-04 0.0463
## 31 1.34e-02 0.0570
## 32 9.98e-04 0.0197
## 33 4.03e-04 0.0502
## 34 1.14e-03 0.0486
## 35 2.86e-03 0.0488
## 36 4.41e-05 0.0241
## 37 3.28e-04 0.0184
## 38 4.71e-03 0.0259
## 39 1.22e-02 0.0548
## 40 8.97e-03 0.0347
## 41 2.35e-04 0.0255
## 42 9.76e-06 0.0213
## 43 4.49e-03 0.0357
## 44 4.48e-03 0.0478
## 45 1.03e-05 0.0406
## 46 4.76e-04 0.0160
## 47 2.23e-05 0.0183
## 48 4.66e-05 0.0155
## 49 1.27e-02 0.0342
## 50 5.34e-03 0.0368
## 51 2.99e-03 0.0224
## 52 5.01e-03 0.0348
## 53 1.30e-04 0.0618
## 54 1.14e-02 0.1010
## 55 8.61e-04 0.0373
## 56 2.47e-04 0.0448
## 57 1.40e-02 0.0567
## 58 5.44e-03 0.0435
## 59 1.27e-02 0.0426
## 60 3.76e-03 0.0301
## 61 2.73e-03 0.0399
## 62 1.13e-02 0.0587
## 63 1.35e-03 0.0466
## 64 3.71e-03 0.0394
## 65 2.72e-03 0.0445
## 66 2.37e-02 0.1317
## 67 5.79e-03 0.0578
## 68 1.71e-04 0.0533
## 69 6.24e-04 0.0349
## 70 1.83e-03 0.1249 *
## 71 2.42e-01 0.2225 *
## 72 6.82e-04 0.0966
## 73 9.33e-06 0.0524
## 74 2.12e-04 0.1211 *
## 75 2.05e-02 0.0774
## 76 4.07e-03 0.0667
## 77 1.09e+00 0.2514 *
## 78 1.42e-03 0.0730
## 79 1.81e-01 0.1925 *
## 80 1.24e-01 0.1569 *
## 81 3.73e-02 0.2008 *
library(car)
## Warning: package 'car' was built under R version 3.4.4
## Loading required package: carData
## Warning: package 'carData' was built under R version 3.4.4
## plotting Influential measures
influenceIndexPlot(model1) # index plots for infuence measures

influencePlot(model1) # A user friendly representation of the above

## StudRes Hat CookD
## 1 2.421762 0.05200781 0.06047977
## 71 -2.100131 0.22253511 0.24164401
## 77 4.503603 0.25138750 1.08651940
# Regression after deleting the 77th observation, which is influential observation
model.car1<-lm(MPG~VOL+SP+HP+WT,data=car[-77,])
summary(model.car1)
##
## Call:
## lm(formula = MPG ~ VOL + SP + HP + WT, data = car[-77, ])
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.3943 -2.3555 -0.5913 1.8978 12.0184
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 27.82675 13.32251 2.089 0.04013 *
## VOL -0.18546 0.50895 -0.364 0.71659
## SP 0.41189 0.14139 2.913 0.00471 **
## HP -0.22664 0.03534 -6.413 1.14e-08 ***
## WT 0.03754 1.51458 0.025 0.98029
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.008 on 75 degrees of freedom
## Multiple R-squared: 0.8192, Adjusted R-squared: 0.8096
## F-statistic: 84.96 on 4 and 75 DF, p-value: < 2.2e-16
# Regression after deleting the 77th & 71st Observations
model.car2<-lm(MPG~VOL+SP+HP+WT,data=car[-c(71,77),])
summary(model.car2)
##
## Call:
## lm(formula = MPG ~ VOL + SP + HP + WT, data = car[-c(71, 77),
## ])
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.9343 -2.3434 -0.5155 1.9756 10.8897
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 25.26269 13.49494 1.872 0.0652 .
## VOL -0.13878 0.50979 -0.272 0.7862
## SP 0.44336 0.14391 3.081 0.0029 **
## HP -0.22953 0.03537 -6.489 8.68e-09 ***
## WT -0.13051 1.51940 -0.086 0.9318
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.001 on 74 degrees of freedom
## Multiple R-squared: 0.8162, Adjusted R-squared: 0.8063
## F-statistic: 82.15 on 4 and 74 DF, p-value: < 2.2e-16
## Variance Inflation factor to check collinearity b/n variables
vif(model1)
## HP VOL SP WT
## 19.92659 638.80608 20.00764 639.53382
## vif>10 then there exists collinearity among all the variables
## Added Variable plot to check correlation b/n variables and o/p variable
avPlots(model1)

## VIF and AV plot has given us an indication to delete "wt" variable
## Final model
finalmodel<-lm(MPG~VOL+SP+HP)
summary(finalmodel)
##
## Call:
## lm(formula = MPG ~ VOL + SP + HP)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.5869 -2.8942 -0.3157 2.1291 15.6669
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 29.92339 14.46589 2.069 0.0419 *
## VOL -0.20165 0.02259 -8.928 1.65e-13 ***
## SP 0.40066 0.15586 2.571 0.0121 *
## HP -0.20670 0.03861 -5.353 8.64e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.46 on 77 degrees of freedom
## Multiple R-squared: 0.7704, Adjusted R-squared: 0.7614
## F-statistic: 86.11 on 3 and 77 DF, p-value: < 2.2e-16
# Evaluate model LINE assumptions
plot(finalmodel)




#Residual plots,QQplot,std-Residuals Vs Fitted,Cook's Distance
qqPlot(model1)

## [1] 1 77
# QQ plot of studentized residuals helps in identifying outlier