Spurious Regression - Visualization
Purpose
If two non stationary series are regressed, the t stat increases
> set.seed(1977) > N <- seq(1000, 1e+05, 5000) > results <- numeric(0) > for (i in seq_along(N)) { + y <- cumsum(rnorm(N[i])) + x <- cumsum(rnorm(N[i])) + fit.sum <- summary(lm(y ~ x)) + results <- c(results, coef(fit.sum)[2, 3]) + } > plot(N, results, pch = 19, col = "blue", ylab = "tstat", xlab = "N") |
clearly t stat diverges
If two stationary series are regressed, the t stat increases
> set.seed(1977) > N <- seq(1000, 2 * 1e+05, 5000) > results <- numeric(0) > for (i in seq_along(N)) { + y <- arima.sim(n = N[i], model = list(ar = 0.9)) + x <- arima.sim(n = N[i], model = list(ar = 0.95)) + fit.sum <- summary(lm(y ~ x)) + results <- c(results, coef(fit.sum)[2, 3]) + } > plot(N, results, pch = 19, col = "blue", ylab = "tstat", xlab = "N") |
clearly t stat converges when you regress 2 stationary processes.