Linear regression

Let's get started with the spurious regression then, which I have seen implemented in the real world far too often. Here we simply build a linear model and examine the results:

    > fit.lm <- lm(Temp ~ CO2, data = climate)

> summary(fit.lm)

Call:
lm(formula = Temp ~ CO2, data = climate)

Residuals:
Min 1Q Median 3Q Max
-0.36411 -0.08986 0.00011 0.09475 0.28763

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.430e-01 2.357e-02 -10.31 <2e-16 ***
CO2 7.548e-05 5.047e-06 14.96 <2e-16 ***
---
Signif. codes:
0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1299 on 93 degrees of freedom
Multiple R-squared: 0.7063, Adjusted R-squared: 0.7032
F-statistic: 223.7 on 1 and 93 DF, p-value: < 2.2e-16

Notice how everything is significant, and we have an adjusted R-squared of 0.7. OK, they're highly correlated but this is all meaningless as discussed by Granger and Newbold (1974). Again, I've seen results like these presented in meetings with many people with advanced degrees, and I had to be the bad guy and challenge the results.

We can plot the serial correlation, starting with a time series plot of the residuals, which produce a clear pattern:

> forecast::checkresiduals(fit.lm)

Breusch-Godfrey test for serial correlation of order up to 10

data: Residuals
LM test = 46.193, df = 10, p-value = 1.323e-06

The output of the preceding code is as follows:

From examining the plots and the Breusch-Godfrey test, it comes as no surprise that we can safely reject the null hypothesis of no autocorrelation. The simple way to deal with autocorrelation is to incorporate lagged variables of the dependent time series and/or to make all of the data stationary. We'll do that next using vector autoregression to identify the appropriate lag structure to incorporate in our causality efforts. One of the structural change points was 1949, so we'll start there.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.60.158