> wheat.reg1 <- lm(wheatyld ~ temp + rain + temprain) > summary(wheat.reg1) Call: lm(formula = wheatyld ~ temp + rain + temprain) Residuals: Min 1Q Median 3Q Max -1.910e-06 -6.630e-07 -1.993e-07 7.635e-07 2.097e-06 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 8.321e-06 7.053e-07 11.799 6.09e-12 *** temp -3.511e-09 2.210e-09 -1.589 0.124259 rain -3.387e-06 7.508e-07 -4.511 0.000122 *** temprain 4.999e-09 2.444e-09 2.045 0.051065 . --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 1.067e-06 on 26 degrees of freedom Multiple R-squared: 0.7252, Adjusted R-squared: 0.6935 F-statistic: 22.87 on 3 and 26 DF, p-value: 1.839e-07 > anova(wheat.reg1) Analysis of Variance Table Response: wheatyld Df Sum Sq Mean Sq F value Pr(>F) temp 1 4.6100e-13 4.6100e-13 0.4042 0.53046 rain 1 7.2962e-11 7.2962e-11 64.0298 1.761e-08 *** temprain 1 4.7670e-12 4.7670e-12 4.1834 0.05107 . Residuals 26 2.9627e-11 1.1400e-12 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > > e_wheat <- resid(wheat.reg1) > > par(mfrow=c(3,2)) > > plot(fitted(wheat.reg1),e_wheat) > qqnorm(e_wheat) > qqline(e_wheat) > plot(rain,e_wheat) > plot(temp,e_wheat) > plot(e_wheat,type="l") > > par(mfrow=c(1,1)) > > # Conduct Shapiro-Wilk Normality test on residuals > > shapiro.test(e_wheat) Shapiro-Wilk normality test data: e_wheat W = 0.9756, p-value = 0.7001 > > # Conduct Breusch-Pagan Test of Homogeneity of Variance > > library(lmtest) > > bptest(wheatyld ~ temp + rain + temprain,studentize=FALSE) Breusch-Pagan test data: wheatyld ~ temp + rain + temprain BP = 3.6023, df = 3, p-value = 0.3077 > > # Conduct Durbin-Watson Test of Uncorrelated Errors > > library(car) > > durbinWatsonTest(wheat.reg1) lag Autocorrelation D-W Statistic p-value 1 -0.07753563 1.991958 0.936 Alternative hypothesis: rho != 0