# L07a.pdf - Regression Modelling Lecture Week 7 ANU RSFAS...

• 30

This preview shows page 1 - 9 out of 30 pages.

Regression ModellingLecture Week 7ANU - RSFASLast Updated: Wed Apr 18 11:22:08 20181 / 30
Multiple Linear RegressionFor theGlobal Temperature Anamolies, we have already considereda multiple regression:yi=β0+β1xi+β2x2i+i;iiidnormal(0, σ2)Let’s examine this further.2 / 30
temp <-read.csv("GTA1880to2017.csv",header=TRUE)mod.temp <-lm(temp\$Value ~ temp\$Year)mod2.temp <-lm(temp\$Value ~ temp\$Year +I(temp\$Year^2))plot(temp\$Year, temp\$Value,pch=16,xlab="Year",ylab="Temperature")abline(mod.temp,col="blue",lwd=3)x.temp <-seq(188000,201701,by=1)lines(x.temp, (coef(mod2.temp)[1] +coef(mod2.temp)[2]*x.temp +coef(mod2.temp)[3]*x.temp^2),lwd=3,col="red")3 / 30
188000190000192000194000196000198000200000202000-0.50.00.51.0YearTemperature4 / 30
summary(mod2.temp)#### Call:## lm(formula = temp\$Value ~ temp\$Year + I(temp\$Year^2))#### Residuals:##Min1QMedian3QMax## -0.46072 -0.09615 -0.003150.091990.53116#### Coefficients:##Estimate Std. Error t value Pr(>|t|)## (Intercept)2.820e+029.853e+0028.62<2e-16 ***## temp\$Year-2.965e-031.012e-04-29.30<2e-16 ***## I(temp\$Year^2)7.789e-092.597e-1029.99<2e-16 ***## ---## Signif. codes:0***0.001**0.01*0.05.0.11#### Residual standard error: 0.1475 on 1642 degrees of freedom## Multiple R-squared:0.8009, Adjusted R-squared:0.8007## F-statistic:3303 on 2 and 1642 DF,p-value: < 2.2e-165 / 30
anova(mod2.temp)## Analysis of Variance Table#### Response: temp\$Value##DfSum Sq Mean Sq F valuePr(>F)## temp\$Year1 124.191 124.191 5707.06 < 2.2e-16 ***## I(temp\$Year^2)119.57419.574899.48 < 2.2e-16 ***## Residuals164235.7310.022## ---## Signif. codes:0***0.001**0.01*0.05.0.116 / 30
What is going on with the F-tests here?