oxide=read.table("oxide.txt",skip=18) names(oxide)=c("day","wind","temp","humid","insol","ox") attach(oxide) pairs(oxide) cor(oxide) ox.lm1=lm(ox ~ day + insol + humid + temp + wind) summary(ox.lm1) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -12.04010 21.20961 -0.568 0.57553 day -0.02997 0.13995 -0.214 0.83227 insol 0.01822 0.05583 0.326 0.74694 humid 0.06818 0.13336 0.511 0.61384 temp 0.55714 0.15347 3.630 0.00133 ** wind -0.44749 0.09103 -4.916 5.14e-05 *** Residual standard error: 2.977 on 24 degrees of freedom Multiple R-Squared: 0.7984, Adjusted R-squared: 0.7564 F-statistic: 19.01 on 5 and 24 DF, p-value: 1.203e-07 plot(fitted(ox.lm1),resid(ox.lm1)) pairs(cbind(resid(ox.lm1),oxide[,1:5])) ox.lm2=lm(ox ~ day + I(day^2) + insol + humid + temp + wind) summary(ox.lm2) (Intercept) -33.410163 18.230624 -1.833 0.07983 . day -0.730849 0.223740 -3.267 0.00339 ** I(day^2) 0.029055 0.007984 3.639 0.00137 ** insol 0.006761 0.045539 0.148 0.88327 humid 0.287954 0.124192 2.319 0.02966 * temp 0.667145 0.128488 5.192 2.90e-05 *** wind -0.406099 0.074940 -5.419 1.66e-05 *** Multiple R-Squared: 0.872, Adjusted R-squared: 0.8387 F-statistic: 26.13 on 6 and 23 DF, p-value: 3.536e-09 pairs(cbind(resid(ox.lm2),oxide[,1:5])) qqnorm(resid(ox.lm2)) ox.lm3=lm(ox ~ day + I(day^2) + humid + temp + wind) summary(ox.lm3) (Intercept) -33.015775 17.664764 -1.869 0.07387 . day -0.739218 0.212066 -3.486 0.00191 ** I(day^2) 0.029137 0.007801 3.735 0.00103 ** humid 0.284712 0.119740 2.378 0.02573 * temp 0.673103 0.119549 5.630 8.51e-06 *** wind -0.407790 0.072544 -5.621 8.71e-06 *** Multiple R-Squared: 0.8719, Adjusted R-squared: 0.8452 F-statistic: 32.68 on 5 and 24 DF, p-value: 5.849e-10 plot(fitted(ox.lm3),resid(ox.lm3)) pairs(cbind(resid(ox.lm3),oxide[,1:5])) qqnorm(resid(ox.lm3)) ox.lm4=lm(ox ~ insol + humid + temp + wind) summary(ox.lm4) (Intercept) -15.49370 13.50647 -1.147 0.26219 insol 0.02275 0.05067 0.449 0.65728 humid 0.09292 0.06535 1.422 0.16743 temp 0.56933 0.13977 4.073 0.00041 *** wind -0.44291 0.08678 -5.104 2.85e-05 *** Multiple R-Squared: 0.798, Adjusted R-squared: 0.7657 F-statistic: 24.69 on 4 and 25 DF, p-value: 2.279e-08 ox.lm5=lm(ox ~ humid + temp + wind) summary(ox.lm5) ox.lm6=lm(ox ~ temp + wind) summary(ox.lm6) (Intercept) -5.20334 11.11810 -0.468 0.644 temp 0.52035 0.10813 4.812 5.05e-05 *** wind -0.42706 0.08645 -4.940 3.58e-05 *** Multiple R-Squared: 0.7773, Adjusted R-squared: 0.7608 F-statistic: 47.12 on 2 and 27 DF, p-value: 1.563e-09 pubexp=read.table("pubexp.txt",header=T,skip=17) attach(pubexp) pairs(pubexp) cor(pubexp) cor(pubexp[,-8]) pub.lm1=lm(EX ~ ECAB + MET + GROW + YOUNG + OLD + WEST) summary(pub.lm1) (Intercept) 356.1818 306.4862 1.162 0.25190 ECAB 1.4185 0.4300 3.298 0.00202 ** MET -0.6602 0.3526 -1.872 0.06832 . GROW 0.5716 0.4251 1.345 0.18615 YOUNG -6.6747 7.4806 -0.892 0.37746 OLD -1.8551 7.1368 -0.260 0.79622 WEST 35.4723 13.7711 2.576 0.01370 * Multiple R-Squared: 0.5994, Adjusted R-squared: 0.5408 F-statistic: 10.22 on 6 and 41 DF, p-value: 6.634e-07 pairs(cbind(resid(pub.lm1),pubexp[,2:7])) pub.lm2=lm(EX ~ ECAB + MET + I(MET^2) + GROW + YOUNG + OLD + WEST) summary(pub.lm2) (Intercept) 119.118461 280.911921 0.424 0.673807 ECAB 1.395420 0.382255 3.650 0.000749 *** MET -3.042142 0.758040 -4.013 0.000256 *** I(MET^2) 0.030914 0.008958 3.451 0.001332 ** GROW 0.695336 0.379504 1.832 0.074371 . YOUNG 0.607602 6.975082 0.087 0.931018 OLD 4.120784 6.574827 0.627 0.534383 WEST 34.073079 12.245464 2.783 0.008192 ** Multiple R-Squared: 0.6913, Adjusted R-squared: 0.6373 F-statistic: 12.8 on 7 and 40 DF, p-value: 1.717e-08 pairs(cbind(resid(pub.lm2),pubexp[,2:7])) plot(fitted(pub.lm2),resid(pub.lm2)) qqnorm(resid(pub.lm2)) pub.lm3=lm(EX ~ ECAB + MET + I(MET^2) + GROW + OLD + WEST) summary(pub.lm3) pub.lm4=lm(EX ~ ECAB + MET + I(MET^2) + GROW + WEST) summary(pub.lm4) pub.lm5=lm(EX ~ ECAB + MET + I(MET^2) + WEST) summary(pub.lm5) plot(fitted(pub.lm5),resid(pub.lm5)) pairs(cbind(resid(pub.lm5),pubexp[,c(2,3,7)])) qqnorm(resid(pub.lm5))