> kenton.reg1 <- lm(cases ~ X1+X2+X3) > summary(kenton.reg1) Call: lm(formula = cases ~ X1 + X2 + X3) Residuals: Min 1Q Median 3Q Max -5.20 -1.95 -0.20 1.50 5.80 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 18.6750 0.7485 24.949 1.25e-13 *** X1 -4.0750 1.2708 -3.207 0.005884 ** X2 -5.2750 1.2708 -4.151 0.000854 *** X3 0.8250 1.3706 0.602 0.556221 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 3.248 on 15 degrees of freedom Multiple R-squared: 0.7881, Adjusted R-squared: 0.7457 F-statistic: 18.59 on 3 and 15 DF, p-value: 2.585e-05 > anova(kenton.reg1) Analysis of Variance Table Response: cases Df Sum Sq Mean Sq F value Pr(>F) X1 1 396.90 396.90 37.6327 1.91e-05 *** X2 1 187.50 187.50 17.7781 0.0007477 *** X3 1 3.82 3.82 0.3623 0.5562213 Residuals 15 158.20 10.55 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > > X1w <- X1 > X2w <- X2 > X3w <- c(rep(0,10),rep(1,4),rep(-0.8,5)) > > kenton.reg2 <- lm(cases ~ X1w+X2w+X3w) > summary(kenton.reg2) Call: lm(formula = cases ~ X1w + X2w + X3w) Residuals: Min 1Q Median 3Q Max -5.20 -1.95 -0.20 1.50 5.80 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 18.6316 0.7450 25.007 1.21e-13 *** X1w -4.0316 1.2467 -3.234 0.005565 ** X2w -5.2316 1.2467 -4.196 0.000779 *** X3w 0.8684 1.4428 0.602 0.556221 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 3.248 on 15 degrees of freedom Multiple R-squared: 0.7881, Adjusted R-squared: 0.7457 F-statistic: 18.59 on 3 and 15 DF, p-value: 2.585e-05 > anova(kenton.reg2) Analysis of Variance Table Response: cases Df Sum Sq Mean Sq F value Pr(>F) X1w 1 396.90 396.90 37.6327 1.91e-05 *** X2w 1 187.50 187.50 17.7781 0.0007477 *** X3w 1 3.82 3.82 0.3623 0.5562213 Residuals 15 158.20 10.55 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > > > X1cm <- c(rep(1,5),rep(0,5),rep(0,4),rep(0,5)) > X2cm <- c(rep(0,5),rep(1,5),rep(0,4),rep(0,5)) > X3cm <- c(rep(0,5),rep(0,5),rep(1,4),rep(0,5)) > X4cm <- c(rep(0,5),rep(0,5),rep(0,4),rep(1,5)) > > kenton.reg3 <- lm(cases ~ X1cm+X2cm+X3cm+X4cm-1) > summary(kenton.reg3) Call: lm(formula = cases ~ X1cm + X2cm + X3cm + X4cm - 1) Residuals: Min 1Q Median 3Q Max -5.20 -1.95 -0.20 1.50 5.80 Coefficients: Estimate Std. Error t value Pr(>|t|) X1cm 14.600 1.452 10.053 4.66e-08 *** X2cm 13.400 1.452 9.226 1.43e-07 *** X3cm 19.500 1.624 12.009 4.28e-09 *** X4cm 27.200 1.452 18.728 8.16e-12 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 3.248 on 15 degrees of freedom Multiple R-squared: 0.9785, Adjusted R-squared: 0.9727 F-statistic: 170.3 on 4 and 15 DF, p-value: 2.64e-12 > anova(kenton.reg3) Analysis of Variance Table Response: cases Df Sum Sq Mean Sq F value Pr(>F) X1cm 1 1065.8 1065.8 101.056 4.663e-08 *** X2cm 1 897.8 897.8 85.126 1.426e-07 *** X3cm 1 1521.0 1521.0 144.216 4.279e-09 *** X4cm 1 3699.2 3699.2 350.746 8.157e-12 *** Residuals 15 158.2 10.5 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > > X1cmeq <- rep(1,19) > > kenton.reg4 <- lm(cases ~ X1cmeq-1) > summary(kenton.reg4) Call: lm(formula = cases ~ X1cmeq - 1) Residuals: Min 1Q Median 3Q Max -8.632 -4.132 -1.632 3.868 14.368 Coefficients: Estimate Std. Error t value Pr(>|t|) X1cmeq 18.632 1.477 12.61 2.26e-10 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 6.44 on 18 degrees of freedom Multiple R-squared: 0.8983, Adjusted R-squared: 0.8927 F-statistic: 159.1 on 1 and 18 DF, p-value: 2.258e-10 > anova(kenton.reg4) Analysis of Variance Table Response: cases Df Sum Sq Mean Sq F value Pr(>F) X1cmeq 1 6595.6 6595.6 159.05 2.258e-10 *** Residuals 18 746.4 41.5 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > > anova(kenton.reg4,kenton.reg3) Analysis of Variance Table Model 1: cases ~ X1cmeq - 1 Model 2: cases ~ X1cm + X2cm + X3cm + X4cm - 1 Res.Df RSS Df Sum of Sq F Pr(>F) 1 18 746.42 2 15 158.20 3 588.22 18.591 2.585e-05 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1