PART XIII · Chapter 107 · 604 / 660

Lesson 604. Econometric traps: non-stationarity, spurious regression, autocorrelation and HAC standard errors

Chapter 107. Regularized Regression, Factor PCA, Time-Series Pitfalls, Microstructure & Kelly

When a macro indicator and a stock index are drawn on one chart, the two lines often move together surprisingly well. Regressing one level on the other gives a high coefficient of determination and a large t-statistic. This lesson measures two cases in which such numbers are not evidence of a relationship.

One is spurious regression, in which two levels that both drift like trends are regressed on each other. The other is regressing an overlapping label, such as the return over the next 12 months, while using ordinary standard errors. Lesson 599 and Lesson 600 showed that when observations depend on each other the information is less than the number of observations, and Lesson 590 covered labels that look ahead. Here we see in numbers how that problem inflates regression t-statistics.

Every relationship in the experiments has a true value of 0. So every "significant" result is a false positive, and the share of such results is the size of the trap this lesson measures.

1. Experiment design: synthetic data with a true relationship of 0

The data are synthetic data made with fixed seeds. The seeds were set before the lesson was written, 500 seeds starting from 20264001, and each seed runs two experiments. Every regression is a hypothetical teaching rule that explains one synthetic variable with another, and "significant" means an absolute t-statistic above 1.96. If there is truly no relationship, the share that comes out significant by this criterion should be near 5%.

The first experiment uses two independent random walks. Two levels, built by adding a standard normal step every period, are regressed on each other at lengths of 60, 240 and 960 periods. The second experiment uses a slowly moving explanatory variable (one-period autocorrelation 0.9) and a monthly return with no relationship to it (standard deviation 4%). The label is the sum of returns over the next 12 months, and there are 240 labels.

2. Non-stationarity: data that do not return to a mean

Stationarity is the property that the mean, variance and autocorrelation of the data do not change over time. Returns are generally close to this property, but values such as the level of a price or an index, or a cumulative money stock, are not. A random walk is a process that makes tomorrow's value by adding noise to today's, so there is no mean to return to, and the swings grow with time.

A test of whether data are close to a random walk is called a unit root test, and the test of Dickey and Fuller (1979) is the best known. In this lesson, just remember its name and its use: before putting a level into a regression, first ask whether that level is stationary.

Drawing two levels on one chart is the same trap. Changing the starting point and the scale of the axes even a little can make two lines look as if they overlap. When both are drifting values, it is common for them to move in the same direction for a long time by chance.

3. Spurious regression: two unrelated random walks

Granger and Newbold (1974), "Spurious Regressions in Econometrics," showed by simulation that regressing independent random walks on each other very often gives significant ordinary t-statistics. Doing the same calculation with 500 seeds on this lesson's synthetic data gives the following.

Length Level regression, share significant Still significant with HAC (lag 4) Median coefficient of determination Coefficient of determination above 50%
60 periods 73.2% 61.0% 20.7% 16.4%
240 periods 85.4% 70.0% 15.5% 16.2%
960 periods 91.6% 84.0% 17.7% 15.6%

Six bars compare the share of seeds that came out significant at the 5% level in regressions whose true relationship is 0. The random-walk level regression gives 85.4% with ordinary standard errors and 70.0% with HAC standard errors at lag 4; the change regression gives 4.8%. The overlapping 12-month return regression gives 50.2% with ordinary standard errors and 17.0% with HAC standard errors at lag 11; the nonoverlapping cuts give 6.8%.

Two levels with no relationship at all came out significant in 85.4% of seeds at 240 periods. More observations might seem to reduce the problem, but at 960 periods it actually rose to 91.6%. Phillips (1986) showed in theory that in such regressions the t-statistic grows with the number of observations. At 240 periods, 16.2% of seeds, about one in six, had a coefficient of determination above 50%.

Even with the autocorrelation correction of section 6 (HAC standard errors, lag 4), 70.0% were significant at 240 periods. Correcting standard errors is a tool for autocorrelation in stationary data, not a tool that fixes non-stationarity.

For the first seed, set before the lesson was written, the t-statistic of the 240-period level regression was −3.62 and the coefficient of determination was 5.2%. It is an example showing that a large t-statistic can come with a small coefficient of determination.

4. Differencing makes the false positives disappear

Regressing the one-period changes of the same two random walks on each other, the share that came out significant was 6.2%, 4.8% and 3.4% at 60, 240 and 960 periods, near 5%. The median coefficient of determination was also 0.2% at 240 periods. For the first seed, the t-statistic of the change regression was 1.13. Turning levels into changes or returns is the first remedy.

There are also cases in which two levels share the same stochastic trend so that their difference is stationary; this is called cointegration. Then a level regression can be meaningful, but deciding that needs a separate test beyond the scope of this lesson. Do not claim cointegration from the t-statistic and coefficient of determination of a level regression alone.

5. Overlapping-period returns: the information in 240 observations

In the second experiment, two neighboring labels share 11 months of returns. So the one-period autocorrelation of the labels had a median of 0.91. The explanatory variable also moves slowly, so the product of the regression residual and the explanatory variable keeps the same sign for long stretches.

Ordinary standard errors assume that observations are independent of each other. Across 500 seeds, compared with how much the slope estimate actually swung (its standard deviation), the median ordinary standard error was 0.34 times that. With the standard error taken as about a third, the t-statistic is inflated about three times, and although the true relationship is 0, 50.2% of seeds came out significant.

Cutting the same data at 12-month intervals and using only the 20 nonoverlapping labels gave a significant share of 6.8%. The number of observations falls to 20, but each observation is independent information, so the ordinary standard error works correctly. The 240 overlapping labels contain far less information than 240 independent observations.

6. HAC (Newey-West) standard errors and the lag length

A HAC standard error reflects both the changing variance and the autocorrelation of the residuals. Newey and West (1987) proposed adding the autocovariances up to a number of periods ahead with declining weights. For overlapping labels, the starting point is to set the lag to at least h − 1 = 11 (h = 12, the number of months each label sums), matching the length of the overlap (Hansen and Hodrick, 1980). The commonly used automatic rule 4 × (number of observations ÷ 100)^(2/9) gives about 4.86 for 240 observations, so a lag of 4.

Lag length Share significant Standard error ÷ actual swing
0 51.6% 0.33
4 27.2% 0.60
11 17.0% 0.72
24 14.8% 0.73

The horizontal axis is the Newey-West lag length, 0 to 24. The share that came out significant is high at lag 0, 51.6%, and falls as the lag grows, to 17.0% at lag 11 and 14.8% at 24, but does not come down to the 5% line. The standard error divided by the actual swing is about 33% at lag 0, rises to 72% near lag 11 and is almost flat after that.

The share significant fell as the lag grew, but even at lag 24 it was 14.8%, not down to 5%. This means that even with HAC standard errors, in this experiment the result "significant" came out about three times the 5% benchmark although the true relationship was 0. The HAC standard error with lag 11 was 0.72 times the actual swing. A HAC standard error is also estimated from the sample, so it tends to come out small when, as in this experiment, there are only 240 observations, the labels overlap by 12 months and the explanatory variable moves slowly. How small it comes out depends on the number of observations and the strength of the autocorrelation, so do not carry the 17.0% or the 0.72 times over to other data. The automatic rule's lag of 4 is shorter than the overlap and gave 27.2%. For overlapping labels, do not use the automatic rule as it is; set the lag based on the length of the overlap.

For the first seed, the t-statistic measured with the ordinary standard error was 2.63, and measured with the HAC standard error at lag 11 it was 1.11. The same slope moved between significant and not significant with the choice of standard error alone. The resulting numbers are values computed under these synthetic settings and say nothing about the properties of real predictive variables.

The record for this lesson is a regression-inference box. Write down whether the variables are levels or changes and how stationarity was checked, the length of the label overlap, and the type of standard error and lag length used. Add the result recomputed on nonoverlapping cuts.

Try it yourself

  1. From sections 3 and 4, read the share significant for the 240-period level regression and change regression, and compare them with the share expected when the true relationship is 0.
  2. From the table in section 3, read the share of seeds whose 240-period level regression had a coefficient of determination above 50%, and choose what to write alongside a level regression's coefficient of determination in a report.
  3. From sections 5 and 6, read the share significant for the overlapping-label regression in three cases: the ordinary standard error, the HAC standard error with lag 11, and the nonoverlapping cuts.
  4. Assumptions: the t-statistic measured with the ordinary standard error is 2.6. If the ordinary standard error is a third of the actual swing, about what is the t-statistic measured with the actual swing?

Answers

First, the level regression is 85.4% and the change regression is 4.8%. With a true relationship of 0 it should be near 5%, so the level regression's 85.4% is almost entirely false positives created by non-stationarity.

Second, 16.2%. With the coefficient of determination, write whether the two variables are levels or changes, how stationarity was checked, and the result of the regression redone on changes.

Third, the ordinary standard error gives 50.2%, the HAC with lag 11 gives 17.0%, and the nonoverlapping cuts give 6.8%. The HAC correction helped a lot, but at this sample size the nonoverlapping observations came closest to 5%.

Fourth, 2.6 ÷ 3 = about 0.87. A number that was significant with the ordinary standard error cannot be told apart from 0 when measured with the actual swing.

Data: synthetic data made with fixed seeds 20264001 to 20264500 (500 seeds, set before the lesson was written). The first experiment uses two independent random walks built from standard normal steps (60, 240 and 960 periods). The second uses an explanatory variable with autocorrelation 0.9 and 240 overlapping 12-month sums of a monthly return unrelated to it (standard deviation 4%). Every true relationship is 0.

Related lessons