May 2019
Intermediate to advanced
664 pages
15h 41m
English
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: ...