A linear regression between "Number of Australian Air Passengers" and "Rice Production in Guinea" reveals a "strong" but probably spurious relationship between the two time series.
library(forecast) library(fpp) ?ausair ?guinearice tseries::adf.test(ausair) # Non-stationary tseries::adf.test(guinearice) # Non-stationary ## Is the number of Air Transport Passengers in Australia related to ## rice production in the country of Guinea (in Africa)? spurious_lm <- tslm(ausair ~ guinearice) summary(spurious_lm)
A Phillips-Ouliaris test reveals that the regression is spurious and should be thrown out.
I want alternate viewpoints, so I test the residuals using the ADF, KPSS, and PP tests from the
## ADF test (null = random walk) tseries::adf.test(spurious_lm$residuals) # spurious ## KPSS test (null = NOT random walk) tseries::kpss.test(spurious_lm$residuals, null="Trend") # spurious ## PP Test (null = random walk) tseries::pp.test(spurious_lm$residuals) # spurious
All the tests agree. The relationship is spurious. Throw the model out.
However, I have questions about the default arguments in the tests. All the default arguments in the 3 tests include "drift" and "trend". When I remove the drift and trend (via the
urca package), I get the exact opposite results.
urca::summary(urca::ur.df(spurious_lm$residuals, type="none")) ### looks wrong urca::summary(urca::ur.kpss(spurious_lm$residuals, type="mu")) ### looks wrong urca::summary(urca::ur.pp(spurious_lm$residuals, model="constant")) ### looks wrong
1. Why is the drift and trend terms so important for testing the stationarity of regression residuals?
2. Should I always include drift and trend when testing for unit roots in the residuals? Or in any time series?
Can I technically use following phrases interchangeably?
- "Testing for stationary residuals"
- "Testing for units roots in the residuals"