assumptions of the linear model and identifying potential outliers and influen

Assumptions of the linear model and identifying

This preview shows page 7 - 13 out of 18 pages.

assumptions of the linear model and identifying potential outliers and influen- tial observations. Define any statistics you use in answering this question and state the associated cut-off values of the statistics used. (8) [ 16 ] 7
Image of page 7
Appendix 1 : Correlation matrix (Hald Data set) - Question 10 =============================================================== y x1 x2 x3 x4 y 1.0000000 0.7307175 0.8162526 -0.53467068 -0.82130504 x1 0.7307175 1.0000000 0.2285795 -0.82413376 -0.24544511 x2 0.8162526 0.2285795 1.0000000 -0.13924238 -0.97295500 x3 -0.5346707 -0.8241338 -0.1392424 1.00000000 0.02953700 x4 -0.8213050 -0.2454451 -0.9729550 0.02953700 1.00000000 | | | | | | | | | | | | y 5 10 20 5 10 15 20 80 100 5 10 20 | | | | || | | x1 | | | | | | | | | | || x2 30 50 70 5 10 15 20 | | | | | | | | | x3 80 100 30 50 70 10 30 50 10 30 50 | | | | | | | | | | | | x4 Figure 1: Scatterplot of the variables in the Hald Data set 8
Image of page 8
Appendix 2 : MODEL 1 - Question 10 =============================================================== fit1=lm(y~x1+x2+x3+x4) summary(fit1) Coefficients: Estimate Std. Error t value Pr(>|t|) -------------------------------------------------------------- (Intercept) 62.4054 70.0710 0.891 0.3991 x1 1.5511 0.7448 2.083 0.0708 . x2 0.5102 0.7238 0.705 0.5009 x3 0.1019 0.7547 0.135 0.8959 x4 -0.1441 0.7091 -0.203 0.8441 -------------------------------------------------------------- Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1 -------------------------------------------------------------- Residual standard error: 2.446 on 8 degrees of freedom Multiple R-Squared: 0.9824, Adjusted R-squared: 0.9736 F-statistic: 111.5 on 4 and 8 DF, p-value: 4.756e-07 -------------------------------------------------------------- Appendix 3 : Single variable models (Hald data set) - Question 10 ================================================================== summary(lm(y~x1)) Coefficients: Estimate Std. Error t value Pr(>|t|) -------------------------------------------------------------- (Intercept) 81.4793 4.9273 16.54 4.07e-09 *** x1 1.8687 0.5264 3.55 0.00455 ** -------------------------------------------------------------- Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1 -------------------------------------------------------------- Residual standard error: 10.73 on 11 degrees of freedom Multiple R-Squared: 0.5339, Adjusted R-squared: 0.4916 F-statistic: 12.6 on 1 and 11 DF, p-value: 0.004552 -------------------------------------------------------------- 9
Image of page 9
summary(lm(y~x2)) Coefficients: Estimate Std. Error t value Pr(>|t|) -------------------------------------------------------------- (Intercept) 57.4237 8.4906 6.763 3.1e-05 *** x2 0.7891 0.1684 4.686 0.000665 *** -------------------------------------------------------------- Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1 -------------------------------------------------------------- Residual standard error: 9.077 on 11 degrees of freedom Multiple R-Squared: 0.6663, Adjusted R-squared: 0.6359 F-statistic: 21.96 on 1 and 11 DF, p-value: 0.0006648 -------------------------------------------------------------- summary(lm(y~x3)) Coefficients: Estimate Std. Error t value Pr(>|t|) -------------------------------------------------------------- (Intercept) 110.2027 7.9478 13.866 2.6e-08 *** x3 -1.2558 0.5984 -2.098 0.0598 . -------------------------------------------------------------- Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1 -------------------------------------------------------------- Residual standard error: 13.28 on 11 degrees of freedom Multiple R-Squared: 0.2859, Adjusted R-squared: 0.221 F-statistic: 4.403 on 1 and 11 DF, p-value: 0.05976 -------------------------------------------------------------- summary(lm(y~x4)) Coefficients: Estimate Std. Error t value Pr(>|t|) -------------------------------------------------------------- (Intercept) 117.5679 5.2622 22.342 1.62e-10 *** x4 -0.7382 0.1546 -4.775 0.000576 *** -------------------------------------------------------------- Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1 -------------------------------------------------------------- Residual standard error: 8.964 on 11 degrees of freedom Multiple R-Squared: 0.6745, Adjusted R-squared: 0.645 F-statistic: 22.8 on 1 and 11 DF, p-value: 0.0005762 \ -------------------------------------------------------------- 10
Image of page 10
Appendix 4 : Backward Selection (Hald data set) - Question 10 =============================================================== stepAIC(lm(y~x1+x2+x3+x4),scope=list(upper=y~x1+x2+x3+x4,lower=~1), direction=c("backward")) Start: AIC=26.94 y ~ x1 + x2 + x3 + x4 Df Sum of Sq RSS AIC - x3 1 0.109 47.973 24.974 - x4 1 0.247 48.111 25.011 - x2 1 2.972 50.836 25.728 <none> 47.864 26.944 - x1 1 25.951 73.815 30.576 Step: AIC=24.97 y ~ x1 + x2 + x4 Df Sum of Sq RSS AIC <none> 47.97 24.97 - x4 1 9.93 57.90 25.42 - x2 1 26.79 74.76 28.74 - x1 1 820.91 868.88 60.63 Call: lm(formula = y ~ x1 + x2 + x4) Coefficients: (Intercept) x1 x2 x4 71.6483 1.4519 0.4161 -0.2365 11
Image of page 11
Appendix 5 : All Subsets regression (Hald data set) - Question 10 ================================================================= leaps.a=leaps(x=a[,2:5],y=a[,1],int=TRUE,method=c("adjr2"),nbest=30 strictly.compatible=TRUE) leaps.a$which 1 2 3 4 1 FALSE FALSE FALSE TRUE 1 FALSE TRUE FALSE FALSE 1 TRUE FALSE FALSE FALSE 1 FALSE FALSE TRUE FALSE 2 TRUE TRUE FALSE FALSE 2 TRUE FALSE FALSE TRUE 2 FALSE FALSE TRUE TRUE 2 FALSE TRUE TRUE FALSE 2 FALSE TRUE FALSE TRUE 2 TRUE FALSE TRUE FALSE 3 TRUE TRUE FALSE TRUE 3 TRUE TRUE TRUE FALSE 3 TRUE FALSE TRUE TRUE 3 FALSE TRUE TRUE TRUE 4 TRUE TRUE TRUE TRUE $label [1] "(Intercept)" "1" "2" "3" "4" $size [1] 2 2 2 2 3 3 3 3 3 3 4 4 4 4 5 $adjr2 [1] 0.6449549 0.6359290 0.4915797 0.2209521 0.9744140 0.9669653 0.9223476 [8] 0.8164305 0.6160725 0.4578001 0.9764473 0.9763796 0.9750415 0.9637599 [15] 0.9735634 12
Image of page 12
Image of page 13

You've reached the end of your free preview.

Want to read all 18 pages?

  • Summer '19
  • Self number, 496

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes