looking for a tutor for Econometrics & Statistics
1
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 1
The Nature of the Problem
• The term autocorrelation may be defined as “correlation between members of series of observations ordered in time [as in time series data] or space [as in cross–sectional data]”.
• In the regression context, the classical linear regression model assumes that such autocorrelation does not exist in the disturbances ui.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 2
The Nature of the Problem
• Symbolically,
• Put simply, the classical model assumes that the disturbance term relating to any observation is not influenced by the disturbance term relating to any other observation.
jiuuExxuu jijiji
0)() ,| ,cov( (3.2.5)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 3
The Nature of the Problem
• For example, suppose we are dealing with quarterly times series data involving the regression of output on labor and capital inputs and there is a strike affecting output in one quarter.
• There is no reason to believe that this disruption will be carried over to the next quarter.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
2
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 4
The Nature of the Problem
• However, if there is such a dependence we have autocorrelation.
• Symbolically,
jiuuE ji
0)( (12.1.1)
• In this situation, the disruption caused by the strike this quarter may very well affect output next quarter.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 5
FIGURE 12.1: Patterns of autocorrelation and nonautocorrelation
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 6
The Nature of the Problem
• Why does serial correlation occur? There are several reasons:
• Inertia. A salient feature of most economic time series is inertia, or sluggishness:
Time series (GNP, price indexes, production, employment, and unemployment) exhibit (business) cycles.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
3
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 7
The Nature of the Problem
• Starting at the bottom of the recession, when economic recovery starts, most of these series start moving upward.
• In this upswing, the value of a series at one point in time is greater than its previous value.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 8
The Nature of the Problem
• Thus, there is a “momentum” built into them, and it continues until something happens (e.g., increase in interest rate or taxes or both) to slow them down.
• Therefore, in regressions involving time series data, successive observations are likely to be interdependent.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 9
The Nature of the Problem
• Specification Bias: Excluded Variables Case. In empirical analysis the researcher often starts with a plausible regression model that may not be the most “perfect” one.
After the regression analysis, the researcher does the postmortem to find out whether the results accord with a priori expectations.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
4
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 10
The Nature of the Problem
The researcher may plot the residuals obtained from the fitted regression and may observe distinct patterns.
These residuals (which are proxies for the ) may suggest that some variables that were originally candidates should now be included.
i û
i u
This is the case of excluded variable specification bias.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 11
The Nature of the Problem
Suppose we have the following demand model:
ttttt uXXXY
4433221 (12.1.2)
where: Y = quantity of beef demanded X2 = price of beef X3 = consumer income X4 = price of pork t = time
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 12
The Nature of the Problem
But for some reason we run the following regression:
(12.1.3)
Running (12.1.3) is tantamount to letting
tttt vXXY
33221
ttt uXv
44
ttttt uXXXY
4433221 (12.1.2)
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
5
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 13
The Nature of the Problem
And to the extent the price of pork affects the consumption of beef, the error or disturbance term v will reflect a systematic pattern.
This will be creating (false) autocorrelation.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 14
The Nature of the Problem
• Specification Bias: Incorrect Functional Form. Suppose the “true” or correct model in a cost–output study is as follows:
But we fit the following model:
iiii u 2
321 outputoutputCost Marginal
(12.1.4)
iii v outputCost Marginal
21 (12.1.5)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 15
FIGURE 12.2: Specification bias: Incorrect functional form
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
6
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 16
The Nature of the Problem
Here we have both overestimation and underestimation with large residuals.
The error term vi is, in fact, equal to .ii u 2output
The error term vi will catch the systematic effect of the term on MC.2output
i
vi will reflect autocorrelation because of the use of an incorrect functional form.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 17
The Nature of the Problem
• Cobweb Phenomenon. The supply of many agricultural commodities reflects the so–called cobweb phenomenon.
In the cobweb phenomenon, supply reacts to price with a lag of one time period because supply decisions take time to implement (the gestation period).
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 18
The Nature of the Problem
Thus, at the beginning of this year’s planting of crops, farmers are influenced by the price prevailing last year, so that their supply function is
Suppose at the end of period t, Pt turns out to be lower than Pt-1.
ttt uP
121 Supply (12.1.6)
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
7
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 19
The Nature of the Problem
Therefore, in period t + 1 farmers may very well decide to produce less than they did in period t.
In this situation the disturbances ut are not expected to be random.
This is because if the farmers overproduce in year t, they are likely to reduce their production in t + 1, leading to the cobweb pattern.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 20
The Nature of the Problem
• Lags. Suppose we have a time series regression of consumption expenditure on income.
It is not uncommon to find that the consumption expenditure in the current period depends, among other things, on the consumption expenditure of the previous period.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 21
The Nature of the Problem
In other words,
ittt u
1321 nconsumptioincomenConsumptio
(12.1.7)
Such an equation is known as autoregression because one of the explanatory variables is the lagged value of the dependent variable.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
8
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 22
The Nature of the Problem
Consumers do not change their consumption habits readily.
If we neglect the lagged term the resulting error term will reflect a systematic pattern due to the influence of the lagged consumption on current consumption.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 23
The Nature of the Problem
• “Manipulation” of Data. In empirical analysis, the raw data are often “manipulated”.
For example, in time series regressions with quarterly data, such data are usually derived from the monthly data by adding three monthly observations and dividing the sum by 3.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 24
The Nature of the Problem
• This averaging introduces smoothness into the data by dampening the fluctuations in the monthly data.
• The graph plotting the quarterly data looks much smoother than the monthly data.
• This smoothness may itself lend to a systematic pattern of the disturbances, thereby introducing autocorrelation.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
9
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 25
The Nature of the Problem
Another source of manipulation is interpolation or extrapolation of data.
For example, the Census of Population is conducted every 10 years, and if data are needed for the intercensal years, a common practice is to interpolate on the basis of some ad hoc assumptions.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 26
The Nature of the Problem
Such data “massaging” might create in the data a systematic pattern that might not exist in the original data.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 27
The Nature of the Problem
• Data Transformation. As an example, consider the following model:
ttt uXY
21 (12.1.8)
where Y = consumption expenditure and X = income.
Since (12.1.8) holds true at every time period, it also holds true in the previous time period, (t – 1).
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
10
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 28
The Nature of the Problem
ttt uXY
21 (12.1.8)
So, we can write (12.1.8) as
Yt-1, Xt-1, and ut-1 are known as the lagged values of Y, X, and u, respectively, here lagged by one period.
11211
ttt uXY (12.1.9)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 29
The Nature of the Problem
ttt uXY
21 (12.1.8)
If we subtract (12.1.9) from (12.1.8), we obtain
11211
ttt uXY (12.1.9)
ttt uXY ΔΔΔ
2 (12.1.10)
where D, the first difference operator, tells us to take successive differences of the variables.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 30
The Nature of the Problem
ttt uXY ΔΔΔ
2 (12.1.10)
Thus,
)(Δ 1
ttt
YYY )(Δ 1
ttt
XXX )(Δ 1
ttt
uuu
For practical purposes, we write (12.1.10) as
ttt vXY ΔΔ
2 (12.1.11)
where .)(Δ 1
tttt
uuuv
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
11
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 31
The Nature of the Problem
11211
ttt uXY (12.1.9)
ttt uXY ΔΔΔ
2 (12.1.10)
Eq. (12.1.9) is known as the level form and Eq. (12.1.10) is known as the (first) difference form.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 32
The Nature of the Problem
(12.1.8)
(12.1.11)
If the error term in (12.1.8) satisfies the standard OLS assumptions, particularly the assumption of no autocorrelation, it can be shown that the error term in (12.1.11) is autocorrelated.
ttt uXY
21
ttt vXY ΔΔ
2
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 33
The Nature of the Problem
• Nonstationarity. When dealing with time series data, we may have to find out if a given time series is stationary.
A time series is stationary if its characteristics (e.g., mean, variance, and covariance) are time invariant; that is, they do not change over time.
If that is not the case, we have a nonstationary time series.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
12
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 34
The Nature of the Problem
In a regression model such as
it is quite possible that both Y and X are nonstationary and therefore the error u is also nonstationary.
ttt uXY
21 (12.1.8)
In that case, the error will exhibit autocorrelation.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 35
The Nature of the Problem
Autocorrelation can be positive (Fig. 12.3a) as well as negative.
Most economic time series generally exhibit positive autocorrelation. Why?
Because most of them either move upward or downward over extended time periods and do not exhibit a constant up –and–down movement (Fig. 12.3b).
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 36
FIGURE 12.3: (a) Positive and (b) negative autocorrelation
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
13
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 37
Relationship between Wages and Productivity in the Business Sector of the United States, 1960-2005
• How do we detect and how do we correct for autocorrelation? Before we turn to these topics, we consider a concrete example.
• Table 12.4 gives data on indexes of real compensation per hour (Y) and output per hour (X) in the business sector of the U.S. economy for 1960–2005 (with 1992 = 100).
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 38
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 39
FIGURE 12.7: Index of compensation (Y) and index of productivity (X), United States, 1960–2005
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
14
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 40
Relationship between Wages and Productivity in the Business Sector of the United States, 1960-2005
• We estimate a linear as well as a log–linear model, with the following results:
3845.2ˆ 0.1739 9765.0
)7813.42( )4874.23(
)0157.0( )3940.1( se
6704.0 7419.32 ˆ
2
dr
t
XY tt
(12.5.1)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 41
Relationship between Wages and Productivity in the Business Sector of the United States, 1960-2005
• The log–linear model results are:
(12.5.1)
0221.0ˆ 0.2176 9845.0
)7996.52( )3680.29(
)0124.0( )0547.0( se
ln6522.0 6067.1 ln
2
dr
t
XY tt
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 42
Detecting Autocorrelation
• There are various ways of examining the residuals.
I. Graphical Method
• We can plot them against time, the time sequence plot as in Fig.12.8, which shows the residuals from the log wages–productivity regression (12.5.2).
• Table 12.5 shows these residuals, along with some other data.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
15
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 43
Detecting Autocorrelation
• Alternatively, we can plot the standardized residuals against time, which are also shown in Figure 12.8 and Table 12.5.
I. Graphical Method
• The standardized residuals are simply the residuals (ui) divided by the standard error of the regression ( ), that is, they are ( ).2̂ ̂/tu
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 44
FIGURE 12.8: Residuals (magnified 100 times) and standardized residuals from the wages– productivity regression (log form: model 12.5.2)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 45
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
16
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 46
FIGURE 12.9: Current residuals versus lagged residuals
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 47
Detecting Autocorrelation
• If we carefully examine Figure 12.8, we notice a peculiar feature.
II. The Runs Test
• Initially, we have several residuals that are negative, then there is a series of positive residuals, and then there are several residuals that are negative.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 48
Detecting Autocorrelation
• If these residuals were purely random, could we observe such a pattern? Intuitively, it seems unlikely.
II. The Runs Test
• This intuition can be checked by the so–called runs test, sometimes known as the Geary test, a nonparametric test.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
17
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 49
Detecting Autocorrelation
II. The Runs Test
• To explain the runs test, we note down the signs (+ or –) of the residuals from the wages–productivity regression (log form), shown in column 1 of Table 12.5.
(--------)(+++++++++++++++++++++)(-----------)(+++)(---)
(12.6.1)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 50
Detecting Autocorrelation
II. The Runs Test
• There are: 8 negative residuals followed by: 21 positive residuals followed by: 11 negative residuals followed by: 3 positive residuals followed by: 3 negative residuals (total of 46 observations).
(--------)(+++++++++++++++++++++)(-----------)(+++)(---)
(12.6.1)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 51
Detecting Autocorrelation
II. The Runs Test
• We now define a run as an uninterrupted sequence of one symbol or attribute, such as + or –.
• We further define the length of a run as the number of elements in it.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
18
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 52
Detecting Autocorrelation
• In the sequence shown in (12.6.1), there are 5 runs:
(--------)(+++++++++++++++++++++)(-----------)(+++)(---)
(12.6.1)
A run of 8 minuses (length 8) a run of 21 pluses (length 21) a run of 11 minuses (length 11) a run of 3 pluses (length 3) a run of 3 minuses (length 3).
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 53
Detecting Autocorrelation
II. The Runs Test
• Now let
runs ofnumber
residuals) (i.e., symbols ofnumber
residuals) (i.e., symbols ofnumber
nsobservatio ofnumber total
2
1
21
R
N
N
NNN
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 54
Detecting Autocorrelation
II. The Runs Test
• The null hypothesis is that the successive outcomes (here, residuals) are independent.
• Assuming that N1 > 0 and N2 > 0 , the number of runs is (asymptotically) normally distributed with the following mean and variance:
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
19
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 55
Detecting Autocorrelation
II. The Runs Test
)1()( )2(2
:Variance
1 2
)( :Mean
2
21212
21
NN NNNNN
N NN
RE
R
Note: N = N1 + N2.
(12.6.2)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 56
Detecting Autocorrelation
II. The Runs Test
• If the null hypothesis of randomness is sustainable, following the properties of the normal distribution, we should expect that
95.0 ]96.1 )( 96.1 )([ obPr RR
RERRE
(12.6.3)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 57
Detecting Autocorrelation
II. The Runs Test
Decision Rule. Do not reject the null hypothesis of randomness with 95% confidence if R, the number of runs, lies in the preceding confidence interval;
reject the null hypothesis if the estimated R lies outside these limits (Note: You can choose any level of confidence you want).
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
20
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 58
Detecting Autocorrelation
II. The Runs Test
• Returning to our example, we know that:
N1 (number of pluses) = 24 N2 (number of minuses) = 22 R = 5.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 59
Detecting Autocorrelation
II. The Runs Test
• Using the formulas given in (12.6.2), we obtain:
32.3
11
24)( 2
R
R
RE
(12.6.4)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 60
Detecting Autocorrelation
II. The Runs Test
• The 95% confidence interval for R is thus:
)5.30 ,5.17()]32.3(96.1 24[
• This interval does not include 5. Hence we can reject the hypothesis that the residuals are random with 95% confidence. The residuals exhibit autocorrelation.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
21
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 61
Detecting Autocorrelation
II. The Runs Test
• In cases where N1 or N2 are < 20, Swed and Eisenhart have developed special tables for the critical values of the runs expected in a random sequence.
• These will give the lower and upper limits of the confidence interval automatically.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 62
Detecting Autocorrelation
N2
N1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 4 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 5 2 2 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 6 2 2 3 3 3 3 4 4 4 4 5 5 5 5 5 5 6 6 7 2 2 3 3 3 4 4 5 5 5 5 5 6 6 6 6 6 6 8 2 3 3 3 4 4 5 5 5 6 6 6 6 6 7 7 7 7 9 2 3 3 4 4 5 5 5 6 6 6 7 7 7 7 8 8 8
10 2 3 3 4 5 5 5 6 6 7 7 7 7 8 8 8 8 9 11 2 3 4 4 5 5 6 6 7 7 7 8 8 8 9 9 9 9 12 2 2 3 4 4 5 6 6 7 7 7 8 8 8 9 9 9 10 10 13 2 2 3 4 5 5 6 6 7 7 8 8 9 9 9 10 10 10 10 14 2 2 3 4 5 5 6 7 7 8 8 9 9 9 10 10 10 11 11 15 2 3 3 4 5 6 6 7 7 8 8 9 9 10 10 11 11 11 12 16 2 3 4 4 5 6 6 7 8 8 9 9 10 10 11 11 11 12 12 17 2 3 4 4 5 6 7 7 8 9 9 10 10 11 11 11 12 12 13 18 2 3 4 5 5 6 7 8 8 9 9 10 10 11 11 12 12 13 13 19 2 3 4 5 6 6 7 8 8 9 10 10 11 11 12 12 13 13 13 20 2 3 4 5 6 6 7 8 9 9 10 10 11 12 12 13 13 13 14
• Lower limit:
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 63
Detecting Autocorrelation
• Upper limit:
N2
N1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2 3 4 9 9 5 9 10 10 11 11 6 9 10 11 12 12 13 13 13 13 7 11 12 13 13 14 14 14 14 15 15 15 8 11 12 13 14 14 15 15 16 16 16 16 17 17 17 17 17 9 13 14 14 15 16 16 16 17 17 18 18 18 18 18 18
10 13 14 15 16 16 17 17 18 18 18 19 19 19 20 20 11 13 14 15 16 17 17 18 19 19 19 20 20 20 21 21 12 13 14 16 16 17 18 19 19 20 20 21 21 21 22 22 13 15 16 17 18 19 19 20 20 21 21 22 22 23 23 14 15 16 17 18 19 20 20 21 22 22 23 23 23 24 15 15 16 18 18 19 20 21 22 22 23 23 24 24 25 16 17 18 19 20 21 21 22 23 23 24 25 25 25 17 17 18 19 20 21 22 23 23 24 25 25 26 26 18 17 18 19 20 21 22 23 24 25 25 26 26 27 19 17 18 20 21 22 23 23 24 25 26 26 27 27 20 17 18 20 21 22 23 24 25 25 26 27 27 28
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
22
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 64
Detecting Autocorrelation
III.Durbin-Watson d Test
• The most celebrated test for detecting serial correlation is the Durbin–Watson d statistic which is defined as
nt t t
nt
t tt
u
uu d
1
2
2
2
1
ˆ
)ˆˆ( (12.6.5)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 65
Detecting Autocorrelation
III.Durbin-Watson d Test
• This is simply the ratio of the sum of squared differences in successive residuals to the RSS.
nt t t
nt
t tt
u
uu d
1
2
2
2
1
ˆ
)ˆˆ( (12.6.5)
• In the numerator of the d statistic the number of observations is n–1 (Why?)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 66
Detecting Autocorrelation
III.Durbin-Watson d Test
It is important to note the assumptions underlying the d statistic.
1. The regression model includes an intercept term. If it is not present, as in the case of regression through the origin, it is necessary to rerun the regression including the intercept term to obtain the RSS.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
23
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 67
Detecting Autocorrelation
III.Durbin-Watson d Test
2. The explanatory variables of the model (the X’s), are nonstochastic, or fixed in repeated sampling.
3. The disturbances ut are generated by the first–order autoregressive scheme: ut = rut-1 + et. Therefore, it cannot be used to detect higher–order autoregressive schemes.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 68
Detecting Autocorrelation
III.Durbin-Watson d Test
4. The error term ut is assumed to be normally distributed.
5. The regression model does not include any lagged value(s) of the dependent variable as one of the explanatory variables.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 69
Detecting Autocorrelation
III.Durbin-Watson d Test
Thus, the test is inappropriate in models of the following type:
ttktKttt uYXXXY
133221 (12.6.6)
where Yt-1 is the one period lagged value of Y. Such models are known as autoregressive models.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
24
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 70
Detecting Autocorrelation
III.Durbin-Watson d Test
6. There are no missing observations in the data.
• The actual test procedure can be explained better with the aid of Figure 12.10, which shows that the limits of d are 0 and 4.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 71
Detecting Autocorrelation
III.Durbin-Watson d Test
• These limits can be established by taking the d formula (12.6.5) and expanding it:
nt t t
nt
t tt
u
uu d
1
2
2
2
1
ˆ
)ˆˆ( (12.6.5)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 72
Detecting Autocorrelation
III.Durbin-Watson d Test
nt t t
nt
t tt
u
uu d
1
2
2
2
1
ˆ
)ˆˆ( (12.6.5)
2
1
2
1
2
ˆ
ˆˆ2ˆˆ
t
tttt
u
uuuu d (12.6.7)
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
25
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 73
Detecting Autocorrelation
III.Durbin-Watson d Test
2
1
2
1
2
ˆ
ˆˆ2ˆˆ
t
tttt
u
uuuu d (12.6.7)
• Since and differ in only one observation, they are approximately equal.
2ˆ tu 2
1 ˆ t u
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 74
Detecting Autocorrelation
III.Durbin-Watson d Test
2
1
2
1
2
ˆ
ˆˆ2ˆˆ
t
tttt
u
uuuu d (12.6.7)
• Setting , (12.6.7) may be written as 22
1 ˆˆ tt uu
2
1
ˆ
ˆˆ 12
t
tt
u
uu d (12.6.8)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 75
Detecting Autocorrelation
III.Durbin-Watson d Test
• Now let us define
2
1
ˆ
ˆˆ ˆ
t
tt
u
uu r (12.6.9)
as the sample first–order coefficient of autocorrelation, an estimator of r.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
26
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 76
Detecting Autocorrelation
III.Durbin-Watson d Test
2
1
ˆ
ˆˆ ˆ
t
tt
u
uu r (12.6.9)
2
1
ˆ
ˆˆ 12
t
tt
u
uu d (12.6.8)
• Using (12.6.9), we can express (12.6.8) as
r̂12 d (12.6.10)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 77
Detecting Autocorrelation
III.Durbin-Watson d Test
• But since , (12.6.10) implies that
r̂12 d (12.6.10)
1 1 r
4 0 d (12.6.11)
• If there is no serial correlation (of the first–order), d is expected to be about 2.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 78
FIGURE 12.10: Durbin-Watson d statistic
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
27
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 79
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
• The BG test is also known as the LM test.
• We use the two–variable regression model to illustrate the test, although many regressors can be added to the model.
• Also, lagged values of the regressand can be added to the model.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 80
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
• Let
• Assume that the error term ut follows the pth–order autoregressive, AR(p), scheme as follows:
ttt uXY
21 (12.6.14)
tptpttt uuuu errr
2211 (12.6.15)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 81
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
• The null hypothesis H0 to be tested is that
(12.6.16)0 : 210
p
H rrr
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
28
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 82
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
• The BG test involves the following steps:
1. Estimate (12.6.14) by OLS and obtain the residuals, .
t û
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 83
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
2. Regress on the original Xt (if there is more than one X variable in the original model, include them also) and
t û
pttt uuu
ˆ , ... ,ˆ ,ˆ
21
where the latter are the lagged values of the estimated residuals in step 1.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 84
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
Note that to run this regression we will have only (n–p) observations (why?). In short, run the following (auxiliary) regression:
and obtain the R2.
tptptttt uuuXu errr
ˆˆˆˆˆˆˆ
221121
(12.6.17)
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
29
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 85
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
3. If the sample size is large (technically, infinite), Breusch and Godfrey have shown that
22 ~)( p
Rpn (12.6.18)
That, is, n–p times the R2 value from the auxiliary regression follows the 2 distribution with p df.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 86
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
• The following practical points about the BG test may be noted:
1. The regressors included in the regression model may contain lagged values of the regressand Y, that is, Yt-1, Yt-2, etc., may appear as explanatory variables.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 87
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
2. As noted earlier, the BG test is applicable even if the disturbances follow a pth–order moving average (MA) process, that is, the ut are generated as follows:
ptptttt u
eeee
2211 (12.6.19)
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
30
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 88
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
3. If in (12.6.15) p = 1, meaning first–order autoregression, then the BG test is known as Durbin’s M test.
tptpttt uuuu errr
2211 (12.6.15)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 89
Detecting Autocorrelation
IV. A General Test for Autocorrelation: The Breusch– Godfrey (BG) Test
4. A drawback of the BG test is that the value of p, the length of the lag, cannot be specified a priori. Some experimentation with the p value is inevitable.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 90
What to Do When You Find Autocorrelation: Remedial Measures
When autocorrelation is present, we have four options:
1. Try to find out if the autocorrelation is pure autocorrelation and not the result of mis–specification of the model.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
31
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 91
What to Do When You Find Autocorrelation: Remedial Measures
2. If it is pure autocorrelation, one can use appropriate transformation of the original model so that in the transformed model we do not have the problem of (pure) autocorrelation.
As in the case of heteroscedasticity, we will have to use some type of generalized least–squares (GLS) method.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 92
What to Do When You Find Autocorrelation: Remedial Measures
3. In large samples, one can use the Newey–West method to obtain standard errors of OLS estimators that are corrected for autocorrelation.
4. In some situations, we can continue to use the OLS method.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 93
Model Mis–Specification Versus Pure Autocorrelation
• In the wages–productivity regression (12.5.2) the d value was 0.2176, indicating positive autocorrelation.
• Could this correlation have arisen because our model was not correctly specified?
• Since the data underlying the regression are time series data, it is quite possible that both wages and productivity exhibit trends.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
32
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 94
Model Mis–Specification Versus Pure Autocorrelation
• To test this, we have included the trend variable t in (12.5.2) and obtained the following results:
0.4497 9900.0
)8903.4( )2594.13( )3939.0(
)0015.0( )0776.0( )3070.0( se
0075.0 ln0283.1 1209.0 ln
2
dR
t
tXY tt
(12.8.1)
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 95
Model Mis–Specification Versus Pure Autocorrelation
• How do we know that (12.8.1) is the correct specification?
• To test this, we regress Y on X and X2 to test for the possibility that the real wage index may be nonlinearly related to the productivity index.
• The results of this regression are as follows:
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 96
Model Mis–Specification Versus Pure Autocorrelation
• It may be safe to conclude from the preceding analysis that our wages–productivity regression probably suffers from pure autocorrelation and not necessarily from specification bias.
0.3561 9906.0
)2785.5( )5040.(7 )7713.2(
)(ln1752.0 ln1963.2 7843.1 ln
2
2
dR
t
XXY ttt
(12.8.2)
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
33
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 97
The Newey–West Method Of Correcting The OLS Standard Errors
• If autocorrelation is present in a model, we can still use OLS but correct the standard errors for autocorrelation by a procedure developed by Newey and West.
• This is an extension of White’s heteroscedasticity – consistent standard errors that we discussed in the previous chapter.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 98
The Newey–West Method Of Correcting The OLS Standard Errors
• The corrected standard errors are known as HAC (heteroscedasticity– and autocorrelation–consistent) standard errors or simply as Newey–West standard errors.
• It is important to point out that the Newey–West procedure is strictly speaking valid only in large samples and may not be appropriate in small samples.
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 99
The Newey–West Method Of Correcting The OLS Standard Errors
• Once again let us return to our wages–productivity regression (12.5.1). We know that this regression suffers from autocorrelation.
• Our sample of 40 observations is reasonably large, so we can use the HAC procedure.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS
34
CHAPTER 12: Autocorrelation: What Happens If the Error Terms Are Correlated?
ANDREW PAIZIS-QC BASIC ECONOMETRICS 5th Ed. 100
The Newey–West Method Of Correcting The OLS Standard Errors
• Using Eviews, we obtain the following results:
0.1719 9765.0
)*0302.0( )*9162.2( se
6704.0 7419.32 ˆ
2
dr
XY tt
(12.10.1)
where * denotes HAC standard errors. The original standard errors were 1.3940 for the intercept and 0.0157 for the slope.
ECO 382 CH 12 HANDOUT - DR. ANDREW PAIZIS