PROBLEM 11: TESTING FOR AUTOCORRELATION

OBJECT OF THE PROBLEM

To run tests for autoregressive disturbance terms.

INTRODUCTION

Autocorrelation is a frequent problem in time series studies

because although OLS remains unbiased and consistent, efficiency

and asymptotic efficiency are lost. Autocorrelation occurs when

the error term of the model is correlated with lagged values of

itself.

The standard test for the presence of autocorrelation is the

Durbin-Watson statisitic. The statistic takes on a value between

0 and 4, and the closer to 2 the less likely it is that there is

an autocorrelation problem. Small values of DW close to 0

indicate positive autocorrelation. Large values of DW close to 4

indicate negative autocorrelation.

The Durbin-Watson is not always an appropriate device for

testing for autocorrelation. Whenever a lagged dependent variable

is one of the independent variables in a model the Durbin-Watson

cannot be used. In this case Durbin's M-test can be used to test.

In Durbin's test we analyze the t-statisitics for the lagged

error term when regressed against the error term. If it is

significant then we may have an autocorrelation problem. The

Durbin-Watson Test tests the null hypothesis of no

autocorrelation against a specific alternative form of

autocorrelation (e.g. first order autocorrelation). A more

general test that is used frequently in more formal time series

analysis is the Portmanteau Test, also known as the Q-Test. See

page 322 in Kmenta (1986, 2nd edition) for a discussion of this

test.

PROBLEM PROGRAM

The following program can be used for the two tests:

//PROB11 JOB (AF,A592),yourname,REGION=4096K

/*OPENBIN

//S0 EXEC TSOLIST,NAME='ACAD.ESP.ECON.QRTRLY'

//S1 EXEC SAS

//ECONDATA DD DSN=ACAD.ECONOMIC.QRTRLY,DISP=SHR

//SYSIN DD *

DATA MACRO; INFILE ECONDATA;

INPUT GNP 28-36 #2 GNPD 64-72 #3 MS 55-63 #4 INR 37-45 #6

UNE 1-9 BEH 28-36 #10;

LABEL GNP = GROSS NATIONAL PRODUCT

GNPD = GNP IMPLICIT PRICE DEFLATOR

MS = M1 DEFINITION OF THE MONEY SUPPLY

INR = GOVERNMENT TREASURY BILL RATE

UNE = UNEMPLOYMENT RATE

BEH = BUDGET EXPENDITURES HIGH EMPLOYMENT;

UNELAG=LAG(UNE);

GNPLAG=LAG(GNP);

MSLAG=LAG(MS);

N+1; IF N > 100 THEN STOP;

PROC REG; MODEL UNE=GNP INR BEH/DW;

TITLE 'DURBIN-WATSON VALID';

PROC REG; MODEL UNE=GNP INR UNELAG BEH/DW;

OUTPUT OUT =NEW R=RESID;

TITLE 'DURBIN WATSON INVALID';

DATA SECOND; SET NEW;

LRESID=LAG(RESID);

PROC REG; MODEL RESID=LRESID GNP INR BEH;

TITLE 'DURBIN'S M-TEST FOR AUTOCORRELATION';

* PORTMANTEAU TEST;

DATA PORT1; SET MACRO;

PROC REG; MODEL UNE = GNP INR BEH;

OUTPUT OUT = NEW2

R = RESID;

DATA PORT2; SET NEW2;

RSDSQ = RESID**2;

LRSD1 = LAG1(RESID);

LRSD2 = LAG2(RESID);

LRSD3 = LAG3(RESID);

IF N>1 THEN NR1 = RESID*LRSD1;

IF N>2 THEN NR2 = RESID*LRSD2;

IF N>3 THEN NR3 = RESID*LRSD3;

PROC MEANS;

VAR RSDSQ NR1 NR2 NR3;

OUTPUT OUT = NEW3

SUM = SRSDSQ SNR1 SNR2 SNR3

N = N;

DATA PORT3; SET NEW3;

RSQ1= (SNR1/SRSDSQ)**2;

RSQ2 = (SNR2/SRSDSQ)**2;

RSQ3 = (SNR3/SRSDSQ)**2;

Q = N*(RSQ1 + RSQ2 + RSQ3);

* A MODIFIED VERSION FOR SMALL SAMPLES;

QSTAR = N*(N+2)*((RSQ1/(N-1)) + (RSQ2/(N-2)) + (RSQ3/(N-3)));

PROC PRINT;

TITLE 'PORMANTEAU TEST OR Q-TEST';

//

Using REG we first run models where the Durbin-Watson is valid

and not valid. Then we output the residuals in a data set, and

use that data set to regress the residual against lagged values

of itself.

INSTRUCTIONS FOR WRITE-UP

Give an intuitive and econometrics notation explanation of each

step of the program, and an intuitive explanation of what the

problem is trying to accomplish. Write down the estimated models

and analyze them. Give an intuitive explanation of each model.

Label all output. Draw a Durbin-Watson distribution, including

the critical points for this problem. Is there any evidence of

autocorrelation? How do you know? Explain. What about in the case

of the lagged dependent variable model? What do the t-statistics

say? Elaborate. In general, what are the properties of the OLS

estimators in the presence of autocorrelation? How does the

Portmanteau Test differ from the Durbin-Watson Test? How are the

formulas different? and what does this difference imply about the

generality of these two tests?