Note 08: Time Series Linear Regression, Multicollinearity & Spuriousness
Module 2: Stationarity & Regression
Learning Objectives
Specify time series multiple linear regression models with TSLM(), including trend() and season() terms, and state the classical OLS assumptions.
Diagnose multicollinearity using Variance Inflation Factors (car::vif()) and identify valid remediation strategies.
Demonstrate spurious regression on independent random walks via Monte Carlo simulation and eliminate spuriousness through differencing.
1. Time Series Linear Models (TSLM) and OLS Assumptions
A time series multiple linear regression relates a response \(y_t\) to \(k\) explanatory predictors \(x_{1t}, \dots, x_{kt}\):
\[
y_t = \beta_0 + \sum_{j=1}^{k} \beta_j x_{jt} + \varepsilon_t, \qquad t = 1, \dots, n.
\]
Ordinary least squares (OLS) minimizes \(\sum_{t=1}^n (y_t - \hat{y}_t)^2\). For standard \(t\)-tests, \(F\)-tests, and confidence intervals to remain valid, the errors \(\varepsilon_t\) must satisfy four core conditions:
Zero conditional mean:\(\mathbb{E}[\varepsilon_t \mid \mathbf{X}] = 0\) (correct functional form and no omitted correlated variables).
Homoscedasticity:\(\operatorname{Var}(\varepsilon_t \mid \mathbf{X}) = \sigma^2\) is constant across time.
No autocorrelation:\(\operatorname{Cov}(\varepsilon_t, \varepsilon_s \mid \mathbf{X}) = 0\) for all \(t \neq s\).
No perfect collinearity among predictors (and approximate normality of \(\varepsilon_t\) for exact small-sample inference).
In time series data, assumption 3 fails routinely. Under positively autocorrelated errors, OLS point estimates \(\hat{\boldsymbol{\beta}}\) may remain unbiased if predictors are strictly exogenous, but conventional OLS standard errors severely underestimate true sampling variability, inflating \(t\)-statistics and generating false positives.
In fable, TSLM() provides convenient deterministic trend() and season() specials for capturing linear drift and seasonal dummy variables alongside external predictors.
beer_recent <- aus_production |>filter_index("1992 Q1"~ .)fit_beer <- beer_recent |>model(tslm =TSLM(Beer ~trend() +season()))tidy(fit_beer) |>select(term, estimate, std.error, statistic, p.value) |>fmt_tbl(digits =3, caption ="TSLM regression of quarterly Australian beer production on linear trend and seasonal dummies.")
TSLM regression of quarterly Australian beer production on linear trend and seasonal dummies.
Figure 1: Quarterly Australian beer production (1992 Q1 onward) with fitted TSLM values from linear trend and quarterly seasonal indicators.
2. Multicollinearity and Variance Inflation Factors
When explanatory variables are strongly correlated with one another, OLS cannot reliably separate their individual partial effects. We quantify multicollinearity for predictor \(j\) using the Variance Inflation Factor (VIF):
\[
\text{VIF}_j = \frac{1}{1 - R_j^2},
\]
where \(R_j^2\) is the \(R^2\) from regressing predictor \(x_j\) on all remaining predictors. As a practical benchmark, \(\text{VIF}_j > 5\) signals moderate collinearity and \(\text{VIF}_j > 10\) signals severe variance inflation (standard errors more than tripled relative to orthogonal predictors). Note that multicollinearity inflates parameter variance and destabilizes individual signs without necessarily hurting in-sample fit.
When computing car::vif(), pass a clean lm() object containing only the response and numeric predictors (never include the tsibble time index column in the formula). Let us evaluate us_change macroeconomic predictors:
fit_us_tslm <- us_change |>model(ols =TSLM(Consumption ~ Income + Production + Savings + Unemployment))fit_us_lm <-lm(Consumption ~ Income + Production + Savings + Unemployment, data = us_change)tidy(fit_us_tslm) |>select(term, estimate, std.error, statistic, p.value) |>left_join(tibble(term =names(car::vif(fit_us_lm)), VIF =as.numeric(car::vif(fit_us_lm))),by ="term" ) |>fmt_tbl(digits =3, caption ="TSLM estimates and VIF diagnostics for U.S. quarterly consumption growth (us_change).")
TSLM estimates and VIF diagnostics for U.S. quarterly consumption growth (us_change).
term
estimate
std.error
statistic
p.value
VIF
(Intercept)
0.253
0.034
7.343
0.000
NA
Income
0.741
0.040
18.461
0.000
2.671
Production
0.047
0.023
2.038
0.043
2.537
Savings
-0.053
0.003
-18.088
0.000
2.506
Unemployment
-0.175
0.096
-1.829
0.069
2.520
All four predictors in us_change have modest VIF values below 3, indicating well-conditioned estimation. When severe collinearity does occur, standard remedies include dropping redundant variables, combining collinear indicators into a composite index or ratio, differencing shared trends, or using regularized regression.
3. Spurious Regression: Monte Carlo Demonstration
Regressing one non-stationary random walk on an entirely independent random walk creates one of the most dangerous illusions in applied statistics (Granger-Newbold spurious regression):
Figure 2: Single pair of independent random walks showing strong apparent correlation in levels (left) that vanishes completely after first differencing (right).
Practice Exercises
Exercise 1: Inducing and Diagnosing Multicollinearity on us_change
Add a near-duplicate predictor Income_proxy = Income + rnorm(n(), 0, 0.15) (set.seed(108)) to us_change. Fit an lm() model predicting Consumption with and without Income_proxy, and compare car::vif() and the standard error of Income.
Solution
Adding a noisy proxy of Income drives both Income and Income_proxy VIFs far above 10 and inflates the standard error of Income dramatically, even though the overall regression \(R^2\) barely changes.
set.seed(108)us_col <- us_change |>as_tibble() |>mutate(Income_proxy = Income +rnorm(n(), 0, 0.15))m_clean <-lm(Consumption ~ Income + Production + Savings + Unemployment, data = us_col)m_col <-lm(Consumption ~ Income + Income_proxy + Production + Savings + Unemployment, data = us_col)tibble(Model =c("Clean predictors", "With near-duplicate Income_proxy"),`Income SE`=c(summary(m_clean)$coefficients["Income", "Std. Error"],summary(m_col)$coefficients["Income", "Std. Error"]),`Income VIF`=c(car::vif(m_clean)["Income"], car::vif(m_col)["Income"]),`Adj. R²`=c(summary(m_clean)$adj.r.squared, summary(m_col)$adj.r.squared)) |>fmt_tbl(digits =3, caption ="Effect of severe collinearity on VIF, coefficient standard error, and adjusted R².")
Effect of severe collinearity on VIF, coefficient standard error, and adjusted R².
Model
Income SE
Income VIF
Adj. R²
Clean predictors
0.040
2.671
0.763
With near-duplicate Income_proxy
0.165
44.729
0.762
Exercise 2: Levels vs. Log-Differenced Country GDPs
Extract annual GDP for "Australia" and "Sweden" from global_economy, join them by Year, and compare OLS regression in levels (Australia ~ Sweden) against OLS on annual log growth rates (Δ log(Australia) ~ Δ log(Sweden)). Report \(R^2\), slope \(t\)-statistic, and lag-1 residual autocorrelation for each.
Solution
In levels, shared global economic growth yields an \(R^2\) near 0.96 with heavily autocorrelated residuals (\(\hat{\rho}_1 > 0.7\)), invalidating OLS inference. On stationary log growth rates, the residual lag-1 autocorrelation drops near zero and \(R^2\) reflects honest annual co-movement in business cycles.
gdp_pair <- global_economy |>filter(Country %in%c("Australia", "Sweden")) |>as_tibble() |>select(Year, Country, GDP) |>pivot_wider(names_from = Country, values_from = GDP) |>drop_na() |>mutate(g_aus =log(Australia) -lag(log(Australia)),g_swe =log(Sweden) -lag(log(Sweden)) )m_gdp_lvl <-lm(Australia ~ Sweden, data = gdp_pair)m_gdp_diff <-lm(g_aus ~ g_swe, data =drop_na(gdp_pair))tibble(Regression =c("Levels: GDP_AUS ~ GDP_SWE", "Log Growth: Δln(AUS) ~ Δln(SWE)"),`R²`=c(summary(m_gdp_lvl)$r.squared, summary(m_gdp_diff)$r.squared),`Slope t-stat`=c(summary(m_gdp_lvl)$coefficients[2, 3], summary(m_gdp_diff)$coefficients[2, 3]),`Resid lag-1 ACF`=c(acf(residuals(m_gdp_lvl), plot =FALSE)$acf[2],acf(residuals(m_gdp_diff), plot =FALSE)$acf[2] )) |>fmt_tbl(digits =3, caption ="Levels vs. log-growth regression between Australian and Swedish GDP.")
Levels vs. log-growth regression between Australian and Swedish GDP.
Regression
R²
Slope t-stat
Resid lag-1 ACF
Levels: GDP_AUS ~ GDP_SWE
0.916
24.75
0.871
Log Growth: Δln(AUS) ~ Δln(SWE)
0.227
4.02
0.142
Key Takeaways
Classical OLS inference in TSLM() requires uncorrelated errors; positive serial correlation underestimates standard errors and produces spurious statistical significance.
Compute car::vif() on a clean lm() excluding the time index; VIF values above 5 to 10 flag severe multicollinearity that destabilizes individual slope estimates.
Regressing independent random walks in levels yields artificially high \(R^2\) and false rejections over 70% of the time at \(n = 200\).
Always verify stationarity of both variables and check residual autocorrelation before interpreting OLS regression statistics on time series.