> power_cells <- read.table("E:\\data\\CH08TA01.txt",header=F, + col.names=c("cycles","chrg","temp")) > > attach(power_cells) > > chrg_c <- (chrg-mean(chrg))/0.4; chrg_c2 <- chrg_c^2 > temp_c <- (temp-mean(temp))/10; temp_c2 <- temp_c^2 > chrgtemp_c <- chrg_c*temp_c > > pc.mod1 <- lm(cycles ~ chrg_c + temp_c + chrg_c2 + temp_c2 + chrgtemp_c) > summary(pc.mod1) Call: lm(formula = cycles ~ chrg_c + temp_c + chrg_c2 + temp_c2 + chrgtemp_c) Residuals: 1 2 3 4 5 6 7 8 9 10 -21.465 9.263 12.202 41.930 -5.842 -31.842 21.158 -25.404 -20.465 7.263 11 13.202 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 162.84 16.61 9.805 0.000188 *** chrg_c -55.83 13.22 -4.224 0.008292 ** temp_c 75.50 13.22 5.712 0.002297 ** chrg_c2 27.39 20.34 1.347 0.235856 temp_c2 -10.61 20.34 -0.521 0.624352 chrgtemp_c 11.50 16.19 0.710 0.509184 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 32.37 on 5 degrees of freedom Multiple R-squared: 0.9135, Adjusted R-squared: 0.8271 F-statistic: 10.57 on 5 and 5 DF, p-value: 0.01086 > anova(pc.mod1) Analysis of Variance Table Response: cycles Df Sum Sq Mean Sq F value Pr(>F) chrg_c 1 18704 18704 17.8460 0.008292 ** temp_c 1 34202 34202 32.6323 0.002297 ** chrg_c2 1 1646 1646 1.5704 0.265552 temp_c2 1 285 285 0.2719 0.624352 chrgtemp_c 1 529 529 0.5047 0.509184 Residuals 5 5240 1048 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > plot(pc.mod1) > > > pc.mod2 <- lm(cycles ~ chrg_c + temp_c) > summary(pc.mod2) Call: lm(formula = cycles ~ chrg_c + temp_c) Residuals: Min 1Q Median 3Q Max -41.000 -13.750 -7.167 10.167 60.167 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 172.000 9.354 18.387 7.88e-08 *** chrg_c -55.833 12.666 -4.408 0.002262 ** temp_c 75.500 12.666 5.961 0.000338 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 31.02 on 8 degrees of freedom Multiple R-squared: 0.8729, Adjusted R-squared: 0.8412 F-statistic: 27.48 on 2 and 8 DF, p-value: 0.0002606 > anova(pc.mod2) Analysis of Variance Table Response: cycles Df Sum Sq Mean Sq F value Pr(>F) chrg_c 1 18704 18704 19.432 0.0022619 ** temp_c 1 34202 34202 35.532 0.0003378 *** Residuals 8 7700 963 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > > anova(pc.mod2, pc.mod1) Analysis of Variance Table Model 1: cycles ~ chrg_c + temp_c Model 2: cycles ~ chrg_c + temp_c + chrg_c2 + temp_c2 + chrgtemp_c Res.Df RSS Df Sum of Sq F Pr(>F) 1 8 7700.3 2 5 5240.4 3 2459.9 0.7823 0.5527 >