> ## Table 9.5, 9.6 and 9.7 > dat=read.table("table9_5.dat") > dat V1 V2 V3 V4 1 1 -1.00 -1.00 91.21 2 2 -1.00 1.00 94.17 3 3 1.00 -1.00 87.46 4 4 1.00 1.00 94.38 5 5 0.00 0.00 93.04 6 6 0.00 0.00 93.06 7 7 -1.41 0.00 93.56 8 8 1.41 0.00 91.17 9 9 0.00 -1.41 88.74 10 10 0.00 1.41 95.08 > time=dat[,2] > temp=dat[,3] > yield=dat[,4] > g=lm(yield ~ time + temp + time:temp + I(time^2), subset=1:6) # model (9.12) using the first 6 runs only > summary(g) # Table 9.6 Call: lm(formula = yield ~ time + temp + time:temp + I(time^2), subset = 1:6) Residuals: 1 2 3 4 5 6 -7.005e-19 6.717e-19 7.648e-19 -1.003e-18 -1.000e-02 1.000e-02 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 93.050000 0.010000 9305.0 6.84e-05 *** time -0.885000 0.007071 -125.2 0.00509 ** temp 2.470000 0.007071 349.3 0.00182 ** I(time^2) -1.245000 0.012247 -101.7 0.00626 ** time:temp 0.990000 0.007071 140.0 0.00455 ** --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.01414 on 1 degrees of freedom Multiple R-Squared: 1, Adjusted R-squared: 1 F-statistic: 4.19e+04 on 4 and 1 DF, p-value: 0.003664 > > g=lm(yield ~ time + temp + time:temp + I(time^2) + I(temp^2)) # model (9.5) using all 10 runs > summary(g) # Table 9.7 (the results are slightly different, probably due to rounding) Call: lm(formula = yield ~ time + temp + time:temp + I(time^2) + I(temp^2)) Residuals: 1 2 3 4 5 6 7 -0.254408 -0.033297 -0.291778 -0.070667 -0.011946 0.008054 0.137006 8 9 10 0.190014 0.320327 0.006694 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 93.05195 0.19802 469.918 1.23e-10 *** time -0.86631 0.09916 -8.737 0.000946 *** temp 2.35944 0.09916 23.795 1.85e-05 *** I(time^2) -0.42777 0.13148 -3.254 0.031271 * I(temp^2) -0.65664 0.13148 -4.994 0.007521 ** time:temp 0.99000 0.14002 7.070 0.002111 ** --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 Residual standard error: 0.28 on 4 degrees of freedom Multiple R-Squared: 0.9945, Adjusted R-squared: 0.9876 F-statistic: 143.8 on 5 and 4 DF, p-value: 0.0001332