Professional Documents
Culture Documents
1. Defining Autocorrelation
Autocorrelation occurs in time-series data more often than in cross-sectional data.
Autocorrelation (or autoregressiion and serial correlation) is a result of the violation of the
nonautocorrelation assumption that each disturbance is uncorrelated with every other disturbance
1.1 Stationarity and Autocorrelation
In the presence of autocorrelation,
E ( t | X ) = E ( s | X ) = 0
Cov( t , t s | X )
= s = s
Corr ( t , t s | X ) =
Var ( t | X ) Var ( t s | X ) 0
1.2 Autoregression and AR(p)
Strong stationarity requires that whole joint distribution is the same over the time periods.
http://www.masil.org
http://www.joomok.org
t = u t + u t 1 + 2 u t 2 ... Each disturbance embodies the entire past history of us, with the most
recent observations receiving greater weight than those in the distant past. The variance and
covariance of disturbances are
u2
2
2 2
4 2
(
...
=
+
+
+
=
= 2
Var
t
u
u
u
2
1
2
Cov( , ) = E ( , ) = E ( , + u ) = Var ( ) = u
t
t 1
t
t 1
t 1
t 1
t
t 1
1 2
3. Detecting Autocorrelation
This section considers several test statistics including Breusch-Godfrey LM, Box-Pierce Q,
Ljung-Box Q, Durbin-Watson d, and Durbin h.
3.1 Lagrange Multiplier Test for AR(p)
http://www.masil.org
http://www.joomok.org
Breusch (1978) and Godfrey (1978) develop a Lagrange multiplier test that can be applied to the
pth order autoregression models. Thus, this test is more general than D-W d and Durbin h. The
null hypothesis is a model without lagged dependent variables, 1 = 2 = ... = p = 0 .2
The LM test consists of several steps. First, regress Y on Xs to get residuals. Compute lagged
residuals up to pth order. Replace missing values for lagged residuals with zeros. Regress t on
Xs and et-1, et-2, and et-p to get R2. Finally compute LM statistic using the R2 and the number
of observations T used in the model.3
LM = TR 2 ~ 2 ( p)
This statistic follows the chi-squared distribution with p degrees of freedom. This BreuschGodfrey LM is preferred to other test statistics.
3.2 Q and Q Test for AR(p)
Box and Pierce (1970) develop the Q test that is asymptotically equivalent to the BreuschGodfrey LM test. Box-Pierce Q has a chi-squared distribution with p degrees of freedom. The Q
statistic is
T
Q = T rj2 ~ 2 ( p ) , where rp =
j =1
e e
t = p +1
T
t t p
e
t =1
2
t
First, regress Y on Xs to get residuals and compute lagged residuals up to pth order. Compute
individual rp s using et2 and et et p . Finally, plug rp s in the formula to compute Box-Pierce Q.
Ljung and Box (1979) refine the Box-Pierce Q test to get Q. You may use information obtained
above. Ljung-Box Q also follows the chi-squared distribution with p degrees of freedom.
rj2
Q' = T (T + 2)
j =1
Tj
~ 2 ( p) .
The Durbin-Watson (D-W) test is based on the principle that if the true disturbances are
autocorrelated, this fact will be revealed through the autocorrelations of the least squares
residuals (Durbin and Watson 1950, 1951, 1971). The null hypothesis is that disturbances are not
autocorrelated, = 0 . The test statistic is
2
This model is viewed as a restricted model, whereas the full or unrestricted model has p lagged dependent
variables.
3
Since missing values in lagged residuals are filled with zero, the number of observations used in the model is the
same as that in the original model.
http://www.masil.org
http://www.joomok.org
d=
(e e
t =2
t 1
)2
e
t =1
2
t
From the Durbin-Watson statistic table (T and k), we get the following decision criteria.4
2
0
dU
dL
d U*
d L*
Reject H0
>0
Inconclusive
(uncertain)
Do not reject H0
H0: = 0
Inconclusive
(uncertain)
Reject H0
<0
D-W d ranges from zero (perfect positive autocorrelation) to 4 (perfect negative autocorrelation).
Note that there are two inconclusive areas where the null hypothesis cannot be tested properly.
The upper and lower limits reflect that the sequence of disturbances depends not only on the
sequence of residuals but also on the sequence of values of independent variables (Derick Boyds
memo). The presence of inconclusive regions, which will large in a small sample, implies
shortcomings in practice (Greene 2003).
The relationship between D-W d and autocorrelation coefficient is known as
e12 + eT2
DW = 2(1 r ) T
et2
t =1
When the sample is large, the last term above will be negligible. Thus, DW 2(1 ) or
1 DW 2
The Durbin-Watson test has been found to be quite powerful when compared with others for
AR(1) processes. However, the test is not likely to be valid when there is a lagged dependent
variable in the equation (Greene 2003).
3.4 Durbin h for AR(1) with a Lagged Dependent Variable
D-W d is often biased toward a finding of no autocorrelation (DW=2) (Greene 2003). Durbin
(1970) proposes a Lagrange multiplier statistic to test autocorrelation in the presence of a lagged
dependent variable. D-W d and Durbin h are known as asymptotically equivalent.
T
T
d
2
1
, where Tslag
< 1.
2
2
1 Tslag
2 1 Tslag
T is the number of observations used in the model with a lagged dependent variable. Compared
2
is the estimated variance of the
to D-W d, Durbin h loses one observation in computation. slag
h=r
OLS coefficient of the lagged dependent variable Yt-1. Simply, this variance is the squared
http://www.masil.org
http://www.joomok.org
2
standard error of the parameter estimator. slag
is also an element in the diagonal of the variance-
covariance matrix.
The h statistic is approximately normally distributed with zero mean and unit variance. Note that
this h test is the one-tailed test.
3.5 Software Issue
The Table 3.1 summarizes procedures and commands that conduct AR(1) test.
STATA .durbina command produces a chi-squared statistic, which is different from the z score.
Table 3.1 Comparison of Computing Test Statistics
SAS 9.3
STATA 9.2
B-G LM
D-W d
AUTOREG /GODFREY=1
REG /DW
AUTOREG /DW=1
AUTOREG /LAGDV= DW=1
-
LIMDEP 8.0
.bgodfrey,lags(p)
.dwstat (.estat dwatson)
Regress
4. Correcting Autocorrelation
The autoregressive error model corrects autocorrelation. If is known, you may take the
generalized least squares (GLS) method. Otherwise, you have to estimate the feasible
generalized least squares (FGLS). If an autoregressive error model also suffers from
heteroscedasticity, you may try the generalized autoregressive conditional heteroscedasticity
(GARCH) model.
4.1 Generalized Least Squares
If is known, the generalized least squares estimator is = ( X ' 1 X ) 1 X ' 1 y , which is
consistent. The variance of parameter estimates is Var ( ) = 2 ( X ' 1 X ) 1 .
GLS needs transformation of dependent variable, independent variables, and the intercept. See
the following.
1 2 0 ... 0
1 ... 0
2
in AR(1),
Since 1 P =
...
... ... ...
... 1
0
1 2
1 2 y
1
1
y2 y1
*
*
, X =
Y =
...
...
1
yT yT 1
http://www.masil.org
1 2 x11
x12 x11
...
x1,T x1,T 1
...
1 2 xk1
xk 2 xk1
...
...
...
... xk ,T xk ,T 1
http://www.joomok.org
Then, regress Y* on X*. In SAS and STATA, the intercept should be suppressed.
4.2 Feasible Generalized Least Squares
In the real world is often unknown. So the feasible generalized least squares (FGLS) seems to
be more plausible than GLS. FGLS begins with estimating . The following methods are
commonly used.
T
e e
r =
e
r1 1 DW 2
Theils (1971) adjusted estimator radj r1 * (T K ) /(T 1) .
t =2
t t 1
2
t
Once you compute r, again perform data transformation. Do not forget to transform the intercept
term.
The Prais-Winsten (1954) and Cochrane-Orcutt (1949) FGLS can be both two-stepped and
iterative. The Prais-Winsten estimator uses all observations, while the Cochrane-Orcutt FGLS
ignores the first observation. The Prais-Winsten FGLS is often called the Yule-Walker method in
SAS (METHOD=YW). You may iterate the procedure to get more satisfactory outputs.
SAS provides two-step, iterative two-step, and maximum likelihood methods, while STATA
supports the first two methods. Instead, STATA allows researchers to use various estimators.
In addition to two-step, iterative two-step, and maximum likelihood methods, LIMDEP supports
the Hatanakas (1974) model for autocorrelation with a lagged dependent variable, which is
asymptotically equivalent to the maximum likelihood model.
4.3 Software Issue
The Table 4.1 summarizes estimation methods supported in each statistical software.
Table 4.1 Comparison Estimation Methods
SAS 9.3
STATA 9.2
LIMDEP 8.0
REG
.regress
Regress
OLS
AUTOREG /YW
.prais, twostep
Regress;AR1;Maxit=1;Rho=
2-step P-W
.prais, corc twostep
Regress;AR1;Maxit=1;Alg=C;Rho=
2-step C-O
.prais, rhotype(dw) twostep
Regress;AR1;Maxit=1
2-step P-W (dw)
.prais, rho(dw) corc twostep
Regress;AR1;Alg=Corc;Maxit=1
2-step C-O (dw)
AUTOREG
/ITYW
.prais
Regress;AR1;
Iterative P-W
.prais,
corc
Regress;AR1;Alg=Corc
Iterative C-O
AUTOREG
/ML
Regress;AR1;Alg=MLE
MLE
2SLS;Inst;AR1;Hatanaka
Two-stage (IV)
AUTOREG /GARCH
.arch, garch(p)
Regress;Model=Garch(p,q,1)
GARCH
* The default types of rho are autocorrelation coefficient in SAS, residual regression-based rho in STATA, and the
D-W d-based rho in LIMDEP.
http://www.masil.org
http://www.joomok.org
STATA has the .dwstat command for D-W d and .durbina for the Durbin h statistic. These
commands are postestimation commands of the .regress. The .durbina produces a chisquared statistic instead of a z score and returns a slightly different p-value.
5.1.1 Data Preparation
gen
gen
gen
gen
gen
lnG=ln(G/Pop)
lnPg=ln(Pg)
lnI=ln(Y)
lnPnc=ln(Pnc)
lnPuc=ln(Puc)
. sum ln*
Variable |
Obs
Mean
Std. Dev.
Min
Max
-------------+-------------------------------------------------------lnG |
36
-.0037086
.1516908 -.3358192
.1602927
lnPg |
36
.6740943
.604228 -.0899247
1.41318
lnI |
36
9.110928
.2048051
8.705497
9.387147
lnPnc |
36
.4431982
.3794222 -.0090407
1.034962
lnPuc |
36
.6636122
.6301064 -.1791266
1.653263
. global OLS "lnG lnPg lnI" // OLS
. global OLS2 "lnG l1.lnG lnPg lnI" // OLS for Durbin h
. global K=5
http://www.masil.org
http://www.joomok.org
. regress $OLS
Source |
SS
df
MS
-------------+-----------------------------Model | .771516959
4
.19287924
Residual | .033836907
31 .001091513
-------------+-----------------------------Total | .805353866
35
.02301011
Number of obs
F( 4,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
176.71
0.0000
0.9580
0.9526
.03304
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.0590955
.0324849
-1.82
0.079
-.125349
.007158
lnI |
1.3734
.0756277
18.16
0.000
1.219156
1.527643
lnPnc | -.1267969
.1269934
-1.00
0.326
-.3858017
.1322079
lnPuc | -.1187082
.0813371
-1.46
0.154
-.2845962
.0471799
_cons | -12.34184
.6748946
-18.29
0.000
-13.7183
-10.96539
-----------------------------------------------------------------------------. predict e, residuals
.
.
.
.
gen
gen
gen
gen
e_2=e^2
ee1=e*l.e
e1_2=l.e^2
e_e1_2=(e-l.e)^2
1.
2.
3.
4.
5.
+-------------------------------------------------------------------+
|
e
L.e
e_2
ee1
e1_2
e_e1_2 |
|-------------------------------------------------------------------|
| .0338152
.
.0011435
.
.
. |
| .0160893
.0338152
.0002589
.0005441
.0011435
.0003142 |
|
.019306
.0160893
.0003727
.0003106
.0002589
.0000103 |
| .0146887
.019306
.0002158
.0002836
.0003727
.0000213 |
| -.0187137
.0146887
.0003502
-.0002749
.0002158
.0011157 |
+-------------------------------------------------------------------+
matrix sum=r(StatTotal)
local s_e_2 = sum[2,2]
local s_ee1 = sum[2,3]
local s_e1_2 = sum[2,4]
local s_e_e1_2 = sum[2,5]
global T = sum[1,1]
//.03383691
//.02281944
//.03340659
//.02046115
//36
Unlike the Durbin-Watson d test, the Breusch-Godfrey Lagrange multiplier test can be applied to
general AR(p) processes. The STATA .bgodfrey, a postestimation command, computes the
statistic up to the pth order. Compare the four LM statistics with those in 5.2.2.
. quietly regress $OLS
(output is skipped)
. bgodfrey,lags(1)
Breusch-Godfrey LM test for autocorrelation
--------------------------------------------------------------------------lags(p) |
chi2
df
Prob > chi2
http://www.masil.org
http://www.joomok.org
-------------+------------------------------------------------------------1
|
16.835
1
0.0000
--------------------------------------------------------------------------H0: no serial correlation
. bgodfrey,lags(2)
Breusch-Godfrey LM test for autocorrelation
--------------------------------------------------------------------------lags(p) |
chi2
df
Prob > chi2
-------------+------------------------------------------------------------2
|
20.825
2
0.0000
--------------------------------------------------------------------------H0: no serial correlation
. bgodfrey,lags(3)
Breusch-Godfrey LM test for autocorrelation
--------------------------------------------------------------------------lags(p) |
chi2
df
Prob > chi2
-------------+------------------------------------------------------------3
|
20.994
3
0.0001
--------------------------------------------------------------------------H0: no serial correlation
. bgodfrey,lags($lag)
In order to manually compute the LM statistic, create p lagged residuals and regress residuals on
all independent variables and all lagged residuals. Do not forget to fill missing in the lagged
residuals with zero.
. gen e1=l1.e
. replace e1=0 if e1==.
Number of obs
F( 3,
32)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
9.22
0.0002
0.4636
0.4133
.02382
-----------------------------------------------------------------------------e |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.0055195
.0156354
-0.35
0.726
-.0373678
.0263289
lnI |
.0108632
.0460709
0.24
0.815
-.0829801
.1047065
e1 |
.6873731
.1307147
5.26
0.000
.421116
.9536301
_cons | -.0956494
.4102647
-0.23
0.817
-.9313312
.7400324
------------------------------------------------------------------------------
The LM statistic is T*R2, which follows a chi-squared distribution with p degrees of freedom.
. local r2=e(r2)
. local lm = ($T)*`r2'
. disp `lm'
http://www.masil.org
// LM statistic
http://www.joomok.org
16.688194
. disp chi2tail(1, `lm')
.00004405
// p-value
Number of obs
F( 4,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
88.47
0.0000
0.9195
0.9091
.18221
-----------------------------------------------------------------------------lnPg |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnI |
.5279324
.4061863
1.30
0.203
-.3004899
1.356355
lnPnc |
.9524263
.6809687
1.40
0.172
-.4364186
2.341271
lnPuc |
.1862664
.4491529
0.41
0.681
-.729787
1.10232
e1 |
.3949087
1.001913
0.39
0.696
-1.648507
2.438324
_cons | -4.681809
3.626033
-1.29
0.206
-12.07715
2.713534
-----------------------------------------------------------------------------. gen ee=e^2
. gen ee1=e*e1
. tabstat ee ee1, stat(n sum mean) save // for AR(1)
stats |
ee
ee1
---------+-------------------N |
36
36
sum | .0338369 .0228194
mean | .0009399 .0006339
-----------------------------. matrix sum=r(StatTotal)
. local r1=sum[2,2]/sum[2,1]
. local Q = $T*(`r1'^2)
// for AR(1)
. disp `Q'
16.373108
. disp chi2tail(1,`Q') // for AR(1)
.00005202
. local Q1 = $T*($T+2)*(`r1'^2/($T-1))
// for AR(1)
. disp `Q1'
17.776517
. disp chi2tail(1,`Q1') // for AR(1)
.00002484
http://www.masil.org
http://www.joomok.org
First, let us compute D-W d manually to make sure it is identical to the statistic provided by
STATA. Note that .dwstat and .estat dwatson are equivalent.
. local dw= `s_e_e1_2'/`s_e_2'
// .60469933
. dwstat
Durbin-Watson d-statistic(
. local rho=1-`dw'/2
5,
36) =
.6046993
. local rho=`s_ee1'/`s_e_2'
Finally, let us compute the Durbin h for a model with a lagged dependent variable. Note that
Durbin h is not a two-tailed test, but a one-tailed test.
. regress $OLS2
Source |
SS
df
MS
-------------+-----------------------------Model | .680487618
5 .136097524
Residual | .014272173
29 .000492144
-------------+-----------------------------Total | .694759791
34 .020434112
Number of obs
F( 5,
29)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
276.54
0.0000
0.9795
0.9759
.02218
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnG |
L1. |
.6877655
.1139042
6.04
0.000
.4548052
.9207257
lnPg | -.0939412
.0225678
-4.16
0.000
-.1400975
-.047785
lnI |
.4312204
.1692678
2.55
0.016
.0850289
.7774119
lnPnc | -.2909653
.0927684
-3.14
0.004
-.4806981
-.1012325
lnPuc |
.1737385
.0717074
2.42
0.022
.0270803
.3203967
_cons | -3.844963
1.524568
-2.52
0.017
-6.963055
-.7268714
-----------------------------------------------------------------------------. matrix list e(V)
symmetric e(V)[6,6]
L.
lnG
lnPg
L.lnG
.01297417
lnPg -.00065925
.0005093
lnI -.01830652
.00067796
lnPnc -.00199992 -.00036491
lnPuc
.00496849 -.00033304
_cons
.16504766 -.00614887
lnI
lnPnc
lnPuc
_cons
.02865159
.0033396
-.00791344
-.25805664
.00860598
-.00550537
-.03035274
.00514196
.07142527
2.3243077
. matrix V = e(V)
. local v_lag = V[1,1] // variance of coefficient of the lagged DV
. predict e, residuals
. gen e_2=e^2
. gen ee1=e*l.e
. list e l.e e_2 ee1 in 1/5
1.
2.
3.
4.
+----------------------------------------------+
|
e
L.e
e_2
ee1 |
|----------------------------------------------|
|
.
.
.
. |
| .0065173
.
.0000425
. |
| .0107834
.0065173
.0001163
.0000703 |
| -.0018847
.0107834
3.55e-06
-.0000203 |
http://www.masil.org
http://www.joomok.org
5. | -.010278
-.0018847
.0001056
.0000194 |
+----------------------------------------------+
. tabstat e e_2 ee1, stat(n sum mean) save
stats |
e
e_2
ee1
---------+-----------------------------N |
35
35
34
sum | -1.86e-09 .0142722 .0017067
mean | -5.32e-11 .0004078 .0000502
---------------------------------------.
.
.
.
matrix sum=r(StatTotal)
local s_e_2 = sum[2,2]
local s_ee1 = sum[2,3]
global T = sum[1,1]
//.0142722
//.0017067
// 35
. local rho=`s_ee1'/`s_e_2'
. disp `rho'
.11958521
. disp $T*`v_lag'
.4540958
// to check if Ts < 1
. local h = `rho'*sqrt($T/(1-$T*`v_lag'))
. disp `h'
.95753197
. disp 1-norm(`h')
.16914941
SAS AUTOREG procedure returns the same Durbin h .9575 (See 5.2.2). Using the alternative
term 1 DW 2 will give you a quite different statistic largely because this sample is not
large sufficiently.
. dwstat
Durbin-Watson d-statistic(
. matrix dw = r(dw)
. local dw = dw[1,1]
6,
35) =
1.743835
// dw
. local h2 = (1-`dw'/2)*sqrt($T/(1-$T*`v_lag'))
. disp `h2'
1.0255711
. disp 1-norm(`h2')
.15254689
Let us run either .durbina or .estat durbinalt to conduct the Durbins alternative test, which
produces a chi-squared statistic whose p-value is different from that of h2 above.
. durbina
http://www.joomok.org
In SAS, you may use the REG procedure of SAS/STAT and the AUTOREG procedure of
SAS/ETS. REG computes the D-W d statistic, while AUTORE produces both D-W d and Durbin
h statistics.
5.2.1 SAS REG Procedure
The /DW option in the REG procedure computes the D-W d statistic.
PROC REG DATA=masil.gasoline;
MODEL lnG = lnPg lnI lnPnc lnPuc /DW;
RUN;
The REG Procedure
Model: MODEL1
Dependent Variable: lnG
Number of Observations Read
Number of Observations Used
36
36
Analysis of Variance
Source
DF
Sum of
Squares
Mean
Square
Model
Error
Corrected Total
4
31
35
0.77152
0.03384
0.80535
0.19288
0.00109
Root MSE
Dependent Mean
Coeff Var
0.03304
-0.00371
-890.84804
R-Square
Adj R-Sq
F Value
Pr > F
176.71
<.0001
0.9580
0.9526
Parameter Estimates
Variable
Intercept
lnPg
lnI
lnPnc
lnPuc
DF
Parameter
Estimate
Standard
Error
t Value
Pr > |t|
1
1
1
1
1
-12.34184
-0.05910
1.37340
-0.12680
-0.11871
0.67489
0.03248
0.07563
0.12699
0.08134
-18.29
-1.82
18.16
-1.00
-1.46
<.0001
0.0786
<.0001
0.3258
0.1545
Durbin-Watson D
Number of Observations
1st Order Autocorrelation
0.605
36
0.674
The first order autocorrelation in the REG procedure is computed using et et 1 and et2 See 5.1.2
for the computation in the STATA.
5.2.2 SAS AUTOREG Procedure
The AUTOREG procedure conducts D-W d and Breusch-Godfrey LM tests. You may specify
the order in the DW= and GODFREY= options. For example, the GODFREY=4 produces LM
statistics up to 4th order autoregression.
http://www.masil.org
http://www.joomok.org
lnG
0.03383691
0.00109
-130.82883
0.9580
0.6047
DFE
Root MSE
AIC
Total R-Square
31
0.03304
-138.74642
0.9580
Variable
Intercept
lnPg
lnI
lnPnc
lnPuc
LM
Pr > LM
16.8353
20.8247
20.9942
21.5360
<.0001
<.0001
0.0001
0.0002
DF
Estimate
Standard
Error
t Value
Approx
Pr > |t|
1
1
1
1
1
-12.3418
-0.0591
1.3734
-0.1268
-0.1187
0.6749
0.0325
0.0756
0.1270
0.0813
-18.29
-1.82
18.16
-1.00
-1.46
<.0001
0.0786
<.0001
0.3258
0.1545
The AUTOREG procedure also compute Durbin h statistics with the /LAGDV and DW options.
The /COVB option returns the variance and covariance matrix of parameter estimates. The
variance of the coefficient of the lagged dependent variable is 0.0129742=.1139^2.
PROC AUTOREG DATA=masil.gasoline;
MODEL lnG = lnG1 lnPg lnI lnPnc lnPuc /LAGDV=lnG1 DW=1 DWPROB COVB;
RUN;
The AUTOREG Procedure
Dependent Variable
lnG
Variable
Intercept
http://www.masil.org
0.01427217
0.0004921
-152.50992
0.9795
0.9575
1.7438
DFE
Root MSE
AIC
Total R-Square
Pr > h
29
0.02218
-161.84201
0.9795
0.1691
DF
Estimate
Standard
Error
t Value
Approx
Pr > |t|
-3.8450
1.5246
-2.52
0.0174
http://www.joomok.org
1
1
1
1
1
0.1139
0.0226
0.1693
0.0928
0.0717
6.04
-4.16
2.55
-3.14
2.42
<.0001
0.0003
0.0164
0.0039
0.0219
Intercept
lnG1
lnPg
lnI
lnPnc
lnPuc
Intercept
lnG1
lnPg
lnI
lnPnc
lnPuc
2.3243077
0.1650477
-0.006149
-0.258057
-0.030353
0.0714253
0.1650477
0.0129742
-0.000659
-0.018307
-0.002
0.0049685
-0.006149
-0.000659
0.0005093
0.000678
-0.000365
-0.000333
-0.258057
-0.018307
0.000678
0.0286516
0.0033396
-0.007913
-0.030353
-0.002
-0.000365
0.0033396
0.008606
-0.005505
0.0714253
0.0049685
-0.000333
-0.007913
-0.005505
0.005142
The AUTOREG procedure estimates the linear regression model with autocorrelation corrected
using the /NLAG=1 option indicating the AR(1) process.
http://www.masil.org
http://www.joomok.org
This section illustrates how to estimate FGLS in STATA. See section 5 for the description of the
data set used.
6.1.1 Data Preparation
. infile Year G Pg Y Pnc Puc Ppt Pd Pn Ps Pop ///
using http://pages.stern.nyu.edu/~wgreene/Text/tables/TableF2-2.txt, clear
. drop if Year==.
. tsset Year
time variable:
.
.
.
.
.
gen
gen
gen
gen
gen
lnG=ln(G/Pop)
lnPg=ln(Pg)
lnI=ln(Y)
lnPnc=ln(Pnc)
lnPuc=ln(Puc)
. sum ln*
// summary statistics
Variable |
Obs
Mean
Std. Dev.
Min
Max
-------------+-------------------------------------------------------lnG |
36
-.0037086
.1516908 -.3358192
.1602927
lnPg |
36
.6740943
.604228 -.0899247
1.41318
lnI |
36
9.110928
.2048051
8.705497
9.387147
lnPnc |
36
.4431982
.3794222 -.0090407
1.034962
lnPuc |
36
.6636122
.6301064 -.1791266
1.653263
. global OLS "lnG lnPg lnI lnPnc lnPuc"
. regress $OLS
Source |
SS
df
MS
-------------+-----------------------------Model | .771516959
4
.19287924
Residual | .033836907
31 .001091513
-------------+-----------------------------Total | .805353866
35
.02301011
Number of obs
F( 4,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
176.71
0.0000
0.9580
0.9526
.03304
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.0590955
.0324849
-1.82
0.079
-.125349
.007158
lnI |
1.3734
.0756277
18.16
0.000
1.219156
1.527643
lnPnc | -.1267969
.1269934
-1.00
0.326
-.3858017
.1322079
lnPuc | -.1187082
.0813371
-1.46
0.154
-.2845962
.0471799
_cons | -12.34184
.6748946
-18.29
0.000
-13.7183
-10.96539
-----------------------------------------------------------------------------.
.
.
.
.
.
predict e, residuals
gen e1=l.e
gen e_2=e^2
gen ee1=e*e1
gen e1_2=e1^2
gen e_e1_2=(e-e1)^2
http://www.masil.org
http://www.joomok.org
matrix sum=r(StatTotal)
local s_e_2 = sum[2,3]
local s_ee1 = sum[2,4]
local s_e1_2 = sum[2,5]
local s_e_e1_2 = sum[2,6]
local T = sum[1,1]
//.03383691
//.02281944
//.03340659
//.02046115
//36
There are various ways of estimating the autocorrelation parameter . Autoregressive effort
models to correct autocorrelation depend on the estimator and estimation methods such as
iterative and matrix likelihood methods. The is often estimated using autocorrelation formula
and Durbin-Watson d.
. local rho=`s_ee1'/`s_e_2'
. dwstat
// DW d
Durbin-Watson d-statistic(
5,
36) =
.6046993
// DW d .60469933
In addition to tscorr (autocorrelation coefficient) and dw (D-W d-based rho), STATA provides
theil (adjustment of autocorrelation coefficient), nagar (adjustment of D-W d-based
coefficient), regress (default option, the coefficient of regression e on et-1 without intercept),
and freg (the coefficient of regression e on et+1 without intercept) options
. local rho=`s_ee1'/`s_e_2'*($T-$K)/($T)
// Nagar .73104236
. regress e e1, noc // for the rho based on regression on the lagged residuals
Source |
SS
df
MS
-------------+-----------------------------Model | .015587547
1 .015587547
Residual | .017105895
34 .000503115
-------------+-----------------------------Total | .032693442
35 .000934098
Number of obs
F( 1,
34)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
30.98
0.0000
0.4768
0.4614
.02243
-----------------------------------------------------------------------------e |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------e1 |
.6830819
.1227206
5.57
0.000
.4336837
.9324801
-----------------------------------------------------------------------------. matrix b1 = e(b)
. local rho = b1[1,1]
. disp `rho'
//.68308194
. gen e0=e[_n+1]
(1 missing value generated)
http://www.masil.org
http://www.joomok.org
. quietly regress e e0, noc // rho based on regression with the leaded residuals
. matrix b2 = e(b)
. local rho = b2[1,1] //.69798216
Once a estimator is determined, variables and the intercept need to be transformed using the
estimator.
. foreach var of global OLS {
2.
gen T`var' = sqrt(1-`rho'^2)*`var' if (_n==1)
3.
replace T`var' = `var'-`rho'*`var'[_n-1] if (_n !=1)
4. }
. gen Intercept = sqrt(1-`rho'^2) if (_n==1)
. replace Intercept = 1 -`rho' if (_n !=1)
Now, you are ready to fits the Prais-Winsten FGLS with the transformed data. The intercept
should be suppressed in the OLS. Thus, the F test and R2 are not reliable.
Let us first uses the estimator computed from the autocorrelation formula.
. local rho=`s_ee1'/`s_e_2'
Number of obs
F( 5,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
57.39
0.0000
0.9025
0.8868
.02159
-----------------------------------------------------------------------------TlnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------TlnPg | -.1463802
.037076
-3.95
0.000
-.2219972
-.0707631
TlnI |
1.278264
.1054467
12.12
0.000
1.063204
1.493324
TlnPnc | -.0398843
.1276357
-0.31
0.757
-.300199
.2204304
TlnPuc | -.0669309
.0766292
-0.87
0.389
-.2232173
.0893554
Intercept | -11.49075
.9390551
-12.24
0.000
-13.40597
-9.575537
------------------------------------------------------------------------------
http://www.masil.org
http://www.joomok.org
The .prais command by default fits the Prais-Winsten FGLS. Use the rhotype(tscorr) option
to specify the type of estimator. The twostep option stops iteration after the first iteration. The
output is the same as the above. Compare SSM, the degree of freedom for the model, F to those
of the above.
. prais $OLS, rhotype(tscorr) twostep // Autocorrelation
Iteration 0:
Iteration 1:
rho = 0.0000
rho = 0.6744
Number of obs
F( 4,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
71.50
0.0000
0.9022
0.8896
.02159
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.1463803
.037076
-3.95
0.000
-.2219974
-.0707632
lnI |
1.278263
.1054466
12.12
0.000
1.063203
1.493323
lnPnc | -.0398849
.1276357
-0.31
0.757
-.3001995
.2204298
lnPuc | -.0669303
.0766292
-0.87
0.389
-.2232166
.089356
_cons | -11.49075
.9390546
-12.24
0.000
-13.40596
-9.575531
-------------+---------------------------------------------------------------rho |
.674395
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.110699
Number of obs
F( 5,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
54.03
0.0000
0.8971
0.8805
.0213
-----------------------------------------------------------------------------TlnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------TlnPg | -.1523066
.0370525
-4.11
0.000
-.2278756
-.0767376
TlnI |
1.266635
.107309
11.80
0.000
1.047777
1.485493
TlnPnc | -.0308443
.1271973
-0.24
0.810
-.2902649
.2285764
TlnPuc | -.0638014
.0758518
-0.84
0.407
-.2185021
.0908993
Intercept |
-11.3873
.955492
-11.92
0.000
-13.33604
-9.438561
------------------------------------------------------------------------------
The rhotype(dw) option uses the D-W d-based estimator when estimating autoregressive
error models.
. prais $OLS, rhotype(dw) twostep
Iteration 0:
Iteration 1:
rho = 0.0000
rho = 0.6977
http://www.masil.org
http://www.joomok.org
Number of obs
F( 4,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
67.24
0.0000
0.8967
0.8833
.0213
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.1523067
.0370525
-4.11
0.000
-.2278757
-.0767377
lnI |
1.266636
.1073091
11.80
0.000
1.047778
1.485494
lnPnc | -.0308446
.1271973
-0.24
0.810
-.2902653
.2285761
lnPuc | -.0638011
.0758518
-0.84
0.407
-.2185019
.0908996
_cons | -11.38731
.9554926
-11.92
0.000
-13.33605
-9.438566
-------------+---------------------------------------------------------------rho |
.6976503
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.137768
The following example uses the Theils estimator, which adjusts the autocorrelation
coefficient.
. local rho=`s_ee1'/`s_e_2'*($T-$K)/($T)
. prais $OLS, rhotype(theil) twostep
Iteration 0:
Iteration 1:
// Theil rho
rho = 0.0000
rho = 0.5781
Number of obs
F( 4,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
89.96
0.0000
0.9207
0.9105
.02285
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.1235462
.0367836
-3.36
0.002
-.1985669
-.0485254
lnI |
1.31413
.0982142
13.38
0.000
1.113821
1.514439
lnPnc | -.0700476
.1289092
-0.54
0.591
-.3329597
.1928645
lnPuc | -.0792208
.0791098
-1.00
0.324
-.2405664
.0821247
_cons | -11.81037
.8751567
-13.50
0.000
-13.59526
-10.02547
-------------+---------------------------------------------------------------rho |
.5780528
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.010610
// Nagar .73104236
rho = 0.0000
rho = 0.7462
http://www.masil.org
Number of obs =
F( 4,
31) =
36
58.73
http://www.joomok.org
Model | .100642676
4 .025160669
Residual | .013280162
31 .000428392
-------------+-----------------------------Total | .113922839
35 .003254938
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
0.0000
0.8834
0.8684
.0207
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.1649401
.0368649
-4.47
0.000
-.2401266
-.0897536
lnI |
1.237828
.1112792
11.12
0.000
1.010872
1.464783
lnPnc | -.0096368
.1261748
-0.08
0.940
-.266972
.2476984
lnPuc | -.0571432
.0740091
-0.77
0.446
-.2080859
.0937994
_cons | -11.13132
.9905196
-11.24
0.000
-13.1515
-9.111143
-------------+---------------------------------------------------------------rho |
.7461546
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.199445
The following uses the default type of estimator, which is obtained by regressing e on et-1
without the intercept.
. prais $OLS, rhotype(regress) twostep
Iteration 0:
Iteration 1:
// default
rho = 0.0000
rho = 0.6831
Number of obs
F( 4,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
69.90
0.0000
0.9002
0.8873
.02148
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.1485802
.0370721
-4.01
0.000
-.2241892
-.0729712
lnI |
1.274075
.1061383
12.00
0.000
1.057605
1.490546
lnPnc | -.0365926
.127477
-0.29
0.776
-.2965837
.2233986
lnPuc | -.0657675
.0763471
-0.86
0.396
-.2214784
.0899434
_cons | -11.45348
.9451596
-12.12
0.000
-13.38115
-9.525816
-------------+---------------------------------------------------------------rho |
.6830819
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.120645
The following uses the estimator obtained by regressing e on et+1 without the intercept.
. prais $OLS, rhotype(freg) twostep
Iteration 0:
Iteration 1:
rho = 0.0000
rho = 0.6980
Number of obs
F( 4,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
67.18
0.0000
0.8966
0.8832
.02129
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
http://www.masil.org
http://www.joomok.org
-------------+---------------------------------------------------------------lnPg | -.1523921
.0370518
-4.11
0.000
-.2279598
-.0768244
lnI |
1.26646
.1073359
11.80
0.000
1.047547
1.485373
lnPnc | -.0307104
.1271908
-0.24
0.811
-.2901177
.2286969
lnPuc | -.0637561
.0758402
-0.84
0.407
-.2184332
.0909209
_cons | -11.38574
.9557293
-11.91
0.000
-13.33497
-9.436521
-------------+---------------------------------------------------------------rho |
.6979822
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.138165
Like Prais-Winsten FGLS, Cochrane-Orcutt FGLS runs OLS with the transform data. Unlike the
Prais-Winsten, the Cochrane-Orcutt ignores the first observation.
Let us begin with Cochrane-Orcutt FGLS using the autocorrelation coefficient.
. regress TlnG TlnPg TlnI TlnPnc TlnPuc Intercept if _n > 1, noconst
Source |
SS
df
MS
-------------+-----------------------------Model | .073993944
5 .014798789
Residual | .014299108
30 .000476637
-------------+-----------------------------Total | .088293052
35 .002522659
Number of obs
F( 5,
30)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
31.05
0.0000
0.8380
0.8111
.02183
-----------------------------------------------------------------------------TlnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------TlnPg |
-.142636
.0380588
-3.75
0.001
-.2203625
-.0649094
TlnI |
1.329594
.1396031
9.52
0.000
1.044487
1.614702
TlnPnc | -.0793608
.1464852
-0.54
0.592
-.3785234
.2198018
TlnPuc | -.0561649
.0797507
-0.70
0.487
-.2190375
.1067078
Intercept | -11.95372
1.249882
-9.56
0.000
-14.50632
-9.401116
------------------------------------------------------------------------------
The .prais command has the corc option to estimate Cochrane-Orcutt FGLS.
. prais $OLS, rhotype(tscorr) twostep corc
Iteration 0:
Iteration 1:
rho = 0.0000
rho = 0.6744
Number of obs
F( 4,
30)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
36.74
0.0000
0.8305
0.8079
.02183
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.1426362
.0380589
-3.75
0.001
-.2203627
-.0649096
lnI |
1.329593
.139603
9.52
0.000
1.044486
1.6147
lnPnc |
-.079361
.1464852
-0.54
0.592
-.3785237
.2198016
lnPuc | -.0561643
.0797507
-0.70
0.487
-.219037
.1067084
_cons |
-11.9537
1.249881
-9.56
0.000
-14.5063
-9.401107
-------------+---------------------------------------------------------------rho |
.674395
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
http://www.masil.org
http://www.joomok.org
Number of obs
F( 5,
30)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
28.41
0.0000
0.8256
0.7966
.02159
-----------------------------------------------------------------------------TlnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------TlnPg | -.1492824
.0382297
-3.90
0.000
-.227358
-.0712069
TlnI |
1.307018
.1448034
9.03
0.000
1.01129
1.602746
TlnPnc | -.0599178
.1461395
-0.41
0.685
-.3583746
.2385389
TlnPuc | -.0563603
.0788697
-0.71
0.480
-.2174338
.1047132
Intercept | -11.75192
1.29727
-9.06
0.000
-14.4013
-9.102544
-----------------------------------------------------------------------------. prais $OLS, rhotype(dw) twostep corc
Iteration 0:
Iteration 1:
rho = 0.0000
rho = 0.6977
Number of obs
F( 4,
30)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
33.33
0.0000
0.8163
0.7918
.02159
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.1492826
.0382297
-3.90
0.000
-.2273581
-.071207
lnI |
1.307019
.1448035
9.03
0.000
1.01129
1.602747
lnPnc |
-.059918
.1461396
-0.41
0.685
-.3583748
.2385388
lnPuc |
-.05636
.0788697
-0.71
0.480
-.2174336
.1047135
_cons | -11.75193
1.297271
-9.06
0.000
-14.40131
-9.102547
-------------+---------------------------------------------------------------rho |
.6976503
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.140131
The followings estimate other autoregressive error models using other estimators such as
Theils estimator. Pay attention to the rhotype() option.
. prais $OLS, rhotype(theil) twostep corc
Iteration 0:
Iteration 1:
rho = 0.0000
rho = 0.5781
Number of obs
F( 4,
30)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
53.70
0.0000
0.8774
0.8611
.02283
------------------------------------------------------------------------------
http://www.masil.org
http://www.joomok.org
lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg |
-.118986
.0370215
-3.21
0.003
-.194594
-.0433779
lnI |
1.385947
.1205699
11.49
0.000
1.13971
1.632183
lnPnc |
-.140429
.1459554
-0.96
0.344
-.4385097
.1576518
lnPuc | -.0554635
.0823714
-0.67
0.506
-.2236882
.1127613
_cons | -12.45608
1.077645
-11.56
0.000
-14.65693
-10.25524
-------------+---------------------------------------------------------------rho |
.5780528
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.059270
. prais $OLS, rhotype(nagar) twostep corc
Iteration 0:
Iteration 1:
rho = 0.0000
rho = 0.7462
Number of obs
F( 4,
30)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
27.31
0.0000
0.7846
0.7558
.02104
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.1643651
.0384036
-4.28
0.000
-.2427958
-.0859344
lnI |
1.245164
.1559178
7.99
0.000
.9267376
1.563591
lnPnc | -.0141688
.1443708
-0.10
0.922
-.3090133
.2806758
lnPuc | -.0561394
.0766464
-0.73
0.470
-.2126722
.1003934
_cons | -11.19776
1.399397
-8.00
0.000
-14.05572
-8.339815
-------------+---------------------------------------------------------------rho |
.7461546
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.174443
. prais $OLS, rhotype(regress) twostep corc
Iteration 0:
Iteration 1:
// default
rho = 0.0000
rho = 0.6831
Number of obs
F( 4,
30)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
35.43
0.0000
0.8253
0.8020
.02174
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.1450741
.0381281
-3.80
0.001
-.222942
-.0672062
lnI |
1.321657
.1415266
9.34
0.000
1.032621
1.610692
lnPnc |
-.07231
.1463868
-0.49
0.625
-.3712718
.2266517
lnPuc | -.0562499
.0794347
-0.71
0.484
-.2184772
.1059774
_cons |
-11.8828
1.267388
-9.38
0.000
-14.47115
-9.294444
-------------+---------------------------------------------------------------rho |
.6830819
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.130955
. prais $OLS, rhotype(freg) twostep corc
http://www.masil.org
http://www.joomok.org
rho = 0.0000
rho = 0.6980
Number of obs
F( 4,
30)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
33.28
0.0000
0.8161
0.7916
.02158
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.1493802
.0382318
-3.91
0.000
-.22746
-.0713004
lnI |
1.306665
.1448787
9.02
0.000
1.010783
1.602547
lnPnc | -.0596277
.1461326
-0.41
0.686
-.3580704
.2388149
lnPuc | -.0563619
.0788564
-0.71
0.480
-.2174081
.1046842
_cons | -11.74877
1.297958
-9.05
0.000
-14.39955
-9.097981
-------------+---------------------------------------------------------------rho |
.6979822
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.140342
STATA provides the iterative two-step estimation method for the Prais-Winsten and CochraneOrcutt FGLS.
. prais $OLS, rhotype(tscorr)
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration
0:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
rho = 0.0000
rho = 0.6744
rho = 0.8361
rho = 0.9030
rho = 0.9273
rho = 0.9366
rho = 0.9403
rho = 0.9419
rho = 0.9426
rho = 0.9428
rho = 0.9430
rho = 0.9430
rho = 0.9430
rho = 0.9431
rho = 0.9431
rho = 0.9431
rho = 0.9431
Number of obs
F( 4,
31)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
36
31.14
0.0000
0.8007
0.7750
.01892
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.2101637
.0347875
-6.04
0.000
-.2811133
-.139214
lnI |
1.071587
.1288525
8.32
0.000
.8087905
1.334383
lnPnc |
.0939725
.1252189
0.75
0.459
-.161413
.3493581
lnPuc | -.0341095
.0653817
-0.52
0.606
-.1674564
.0992375
_cons | -9.666983
1.148614
-8.42
0.000
-12.0096
-7.324369
http://www.masil.org
http://www.joomok.org
-------------+---------------------------------------------------------------rho |
.9430583
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.531091
0:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
rho = 0.0000
rho = 0.6744
rho = 0.8080
rho = 0.9037
rho = 0.9235
rho = 0.9279
rho = 0.9294
rho = 0.9300
rho = 0.9301
rho = 0.9302
rho = 0.9303
rho = 0.9303
rho = 0.9303
rho = 0.9303
rho = 0.9303
Number of obs
F( 4,
30)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
35
21.15
0.0000
0.7382
0.7033
.0188
-----------------------------------------------------------------------------lnG |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnPg | -.2223182
.036462
-6.10
0.000
-.2967836
-.1478527
lnI |
.8847412
.2033351
4.35
0.000
.4694755
1.300007
lnPnc |
.091974
.1237493
0.74
0.463
-.1607557
.3447038
lnPuc | -.0422291
.0655293
-0.64
0.524
-.1760577
.0915996
_cons | -7.865689
1.897604
-4.15
0.000
-11.74111
-3.990264
-------------+---------------------------------------------------------------rho |
.9302665
-----------------------------------------------------------------------------Durbin-Watson statistic (original)
0.604699
Durbin-Watson statistic (transformed) 1.515506
SAS support both (iterative) two-step Prais-Winten and maximum likelihood algorithms.
6.2.1 Two-step Prais-Winsten Estimation
Once variables are transformed, run OLS with the intercept suppressed in the REG procedure.
SAS by default uses the autocorrelation coefficient as the estimator.
PROC REG DATA=masil.gasoline;
MODEL TlnG = Intercept TlnPg TlnI TlnPnc TlnPuc /NOINT;
RUN;
The REG Procedure
Model: MODEL1
Dependent Variable: TlnG
http://www.masil.org
http://www.joomok.org
36
36
DF
Sum of
Squares
Mean
Square
Model
Error
Uncorrected Total
5
31
36
0.13379
0.01445
0.14825
0.02676
0.00046625
Root MSE
Dependent Mean
Coeff Var
0.02159
0.00352
614.10313
R-Square
Adj R-Sq
F Value
Pr > F
57.39
<.0001
0.9025
0.8868
Parameter Estimates
Variable
Intercept
TlnPg
TlnI
TlnPnc
TlnPuc
DF
Parameter
Estimate
Standard
Error
t Value
Pr > |t|
1
1
1
1
1
-11.49075
-0.14638
1.27826
-0.03988
-0.06693
0.93906
0.03708
0.10545
0.12764
0.07663
-12.24
-3.95
12.12
-0.31
-0.87
<.0001
0.0004
<.0001
0.7568
0.3891
The AUTOREG procedure estimates autoregressive error models without data transformation.
The /NLAG=1 specifies the first-order autocorrelation. AUTOREG by default (METHOD=YW)
computes the Yule-Walker (Prais-Winsten) FGLS estimates.
PROC AUTOREG DATA=masil.gasoline;
MODEL lnG = lnPg lnI lnPnc lnPuc /NLAG=1;
RUN;
The AUTOREG Procedure
Dependent Variable
lnG
Variable
Intercept
lnPg
lnI
lnPnc
lnPuc
0.03383691
0.00109
-130.82883
0.9580
0.6047
DFE
Root MSE
AIC
Total R-Square
31
0.03304
-138.74642
0.9580
DF
Estimate
Standard
Error
t Value
Approx
Pr > |t|
1
1
1
1
1
-12.3418
-0.0591
1.3734
-0.1268
-0.1187
0.6749
0.0325
0.0756
0.1270
0.0813
-18.29
-1.82
18.16
-1.00
-1.46
<.0001
0.0786
<.0001
0.3258
0.1545
Estimates of Autocorrelations
http://www.masil.org
http://www.joomok.org
Lag
Covariance
Correlation
0
1
0.000940
0.000634
1.000000
0.674395
-1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1
|
|
|********************|
|*************
|
Preliminary MSE
0.000512
Coefficient
Standard
Error
t Value
-0.674395
0.134807
-5.00
Yule-Walker Estimates
SSE
MSE
SBC
Regress R-Square
Durbin-Watson
Variable
Intercept
lnPg
lnI
lnPnc
lnPuc
0.01445373
0.0004818
-157.26029
0.9019
1.1161
DFE
Root MSE
AIC
Total R-Square
30
0.02195
-166.7614
0.9821
DF
Estimate
Standard
Error
t Value
Approx
Pr > |t|
1
1
1
1
1
-11.4907
-0.1464
1.2783
-0.0399
-0.0669
0.9546
0.0377
0.1072
0.1297
0.0779
-12.04
-3.88
11.93
-0.31
-0.86
<.0001
0.0005
<.0001
0.7607
0.3970
The AUTOREG procedure can correct autocorrelation using the iterative Yule-Walker method
(METHOD=ITYW).
PROC AUTOREG DATA=masil.gasoline;
MODEL lnG = lnPg lnI lnPnc lnPuc /NLAG=1 METHOD=ITYW;
RUN;
The AUTOREG Procedure
Dependent Variable
lnG
Variable
Intercept
lnPg
lnI
lnPnc
lnPuc
http://www.masil.org
0.03383691
0.00109
-130.82883
0.9580
0.6047
DFE
Root MSE
AIC
Total R-Square
31
0.03304
-138.74642
0.9580
DF
Estimate
Standard
Error
t Value
Approx
Pr > |t|
1
1
1
1
1
-12.3418
-0.0591
1.3734
-0.1268
-0.1187
0.6749
0.0325
0.0756
0.1270
0.0813
-18.29
-1.82
18.16
-1.00
-1.46
<.0001
0.0786
<.0001
0.3258
0.1545
http://www.joomok.org
Lag
Covariance
Correlation
0
1
0.000940
0.000634
1.000000
0.674395
-1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1
|
|
|********************|
|*************
|
Preliminary MSE
0.000512
Coefficient
Standard
Error
t Value
-0.674395
0.134807
-5.00
Algorithm converged.
Yule-Walker Estimates
SSE
MSE
SBC
Regress R-Square
Durbin-Watson
Variable
Intercept
lnPg
lnI
lnPnc
lnPuc
0.01109864
0.0003700
-165.18245
0.8093
1.4670
DFE
Root MSE
AIC
Total R-Square
30
0.01923
-174.68356
0.9862
DF
Estimate
Standard
Error
t Value
Approx
Pr > |t|
1
1
1
1
1
-9.6703
-0.2101
1.0720
0.0938
-0.0341
1.1670
0.0354
0.1309
0.1273
0.0665
-8.29
-5.94
8.19
0.74
-0.51
<.0001
<.0001
<.0001
0.4670
0.6113
The AUTOREG procedure also estimates the maximum likelihood model (METHOD=ML).
PROC AUTOREG DATA=masil.gasoline;
MODEL lnG = lnPg lnI lnPnc lnPuc/NLAG=1 METHOD=ML;
RUN;
The AUTOREG Procedure
Dependent Variable
lnG
Variable
http://www.masil.org
DF
0.03383691
0.00109
-130.82883
0.9580
0.6047
Estimate
DFE
Root MSE
AIC
Total R-Square
Standard
Error
t Value
31
0.03304
-138.74642
0.9580
Approx
Pr > |t|
http://www.joomok.org
1
1
1
1
1
-12.3418
-0.0591
1.3734
-0.1268
-0.1187
0.6749
0.0325
0.0756
0.1270
0.0813
-18.29
-1.82
18.16
-1.00
-1.46
<.0001
0.0786
<.0001
0.3258
0.1545
Estimates of Autocorrelations
Lag
Covariance
Correlation
0
1
0.000940
0.000634
1.000000
0.674395
-1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1
|
|
Preliminary MSE
|********************|
|*************
|
0.000512
Coefficient
Standard
Error
t Value
-0.674395
0.134807
-5.00
Algorithm converged.
Maximum Likelihood Estimates
SSE
MSE
SBC
Regress R-Square
Durbin-Watson
Variable
Intercept
lnPg
lnI
lnPnc
lnPuc
AR1
0.01114101
0.0003714
-165.23436
0.8147
1.4476
DFE
Root MSE
AIC
Total R-Square
30
0.01927
-174.73547
0.9862
DF
Estimate
Standard
Error
t Value
Approx
Pr > |t|
1
1
1
1
1
1
-9.7543
-0.2082
1.0817
0.0886
-0.0349
-0.9302
1.1530
0.0368
0.1295
0.1333
0.0669
0.0849
-8.46
-5.66
8.35
0.66
-0.52
-10.95
<.0001
<.0001
<.0001
0.5114
0.6054
<.0001
DF
Estimate
Standard
Error
t Value
Approx
Pr > |t|
1
1
1
1
1
-9.7543
-0.2082
1.0817
0.0886
-0.0349
1.1523
0.0355
0.1294
0.1268
0.0669
-8.46
-5.87
8.36
0.70
-0.52
<.0001
<.0001
<.0001
0.4903
0.6053
LIMDEP supports (iterative) two-step, maximum likelihood, and Hatanakas (1974) two-stage
model.
http://www.masil.org
http://www.joomok.org
In LIMDEP, the Regress command has the AR1 option to fit autocorrelation error models. First,
estimate OLS without considering autocorrelation. Note that LIMDEP by default report D-W d
based estimator .69765.
--> REGRESS;Lhs=LNG;Rhs=ONE,LNPG,LNI,LNPNC,LNPUC$
+-----------------------------------------------------------------------+
| Ordinary
least squares regression
Weighting variable = none
|
| Dep. var. = LNG
Mean= -.3708600000E-02, S.D.=
.1516908393
|
| Model size: Observations =
36, Parameters =
5, Deg.Fr.=
31 |
| Residuals: Sum of squares= .3383693649E-01, Std.Dev.=
.03304 |
| Fit:
R-squared= .957985, Adjusted R-squared =
.95256 |
| Model test: F[ 4,
31] = 176.71,
Prob value =
.00000 |
| Diagnostic: Log-L =
74.3732, Restricted(b=0) Log-L =
17.3181 |
|
LogAmemiyaPrCrt.=
-6.690, Akaike Info. Crt.=
-3.854 |
| Autocorrel: Durbin-Watson Statistic =
.60470,
Rho =
.69765 |
+-----------------------------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-12.34185146
.67489522 -18.287
.0000
LNPG
-.5909591880E-01 .32484970E-01
-1.819
.0786
.67409429
LNI
1.373400354
.75627733E-01
18.160
.0000
9.1109277
LNPNC
-.1267972409
.12699351
-.998
.3258
.44319819
LNPUC
-.1187078514
.81337098E-01
-1.459
.1545
.66361220
(Note: E+nn or E-nn means multiply by 10 to + or -nn power.)
LIMDEP by default uses the iterative Prais-Winten algorithm and D-W d based rho. The
Maxit=1 option is needed to fit the two-step model without iteration. The Rho= option specifies
estimator other than the D-W d based rho. Let us get the two-step Prais-Winsten estimates
using the autocorrelation coefficient .67439496.
--> REGRESS;Lhs=LNG;Rhs=ONE,LNPG,LNI,LNPNC,LNPUC;Ar1;Maxit=1;Rho=.67439496$
+---------------------------------------------+
| AR(1) Model:
e(t) = rho * e(t-1) + u(t) |
| Initial value of rho
=
.67439 |
| RHO fixed at this value. No iterations done |
| Method = Prais - Winsten
|
| Iter= 1, SS=
.014, Log-L= 89.380783 |
| Final value of Rho
=
.674395 |
| Iter= 1, SS=
.014, Log-L= 89.380783 |
| Durbin-Watson:
e(t) =
.294576 |
| Std. Deviation: e(t) =
.029244 |
| Std. Deviation: u(t) =
.021593 |
| Durbin-Watson:
u(t) =
1.097155 |
| Autocorrelation: u(t) =
.451423 |
| N[0,1] used for significance levels
|
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-11.49076580
.93905346 -12.237
.0000
LNPG
-.1463812539
.37075971E-01
-3.948
.0001
.67409429
LNI
1.278265561
.10544651
12.122
.0000
9.1109277
LNPNC
-.3988606680E-01
.12763530
-.313
.7547
.44319819
LNPUC
-.6692949378E-01 .76628962E-01
-.873
.3824
.66361220
RHO
.6743949600
.12480744
5.403
.0000
(Note: E+nn or E-nn means multiply by 10 to + or -nn power.)
http://www.masil.org
http://www.joomok.org
These outputs are identical to what STATA produces. Now let us use the D-W d based
estimator to find the same results.
--> REGRESS;Lhs=LNG;Rhs=ONE,LNPG,LNI,LNPNC,LNPUC;Ar1;Maxit=1$
+---------------------------------------------+
| AR(1) Model:
e(t) = rho * e(t-1) + u(t) |
| Initial value of rho
=
.69765 |
| Maximum iterations
=
1 |
| Method = Prais - Winsten
|
| Iter= 1, SS=
.014, Log-L= 89.845024 |
| Final value of Rho
=
.862570 |
| Iter= 1, SS=
.014, Log-L= 89.845024 |
| Durbin-Watson:
e(t) =
.274861 |
| Std. Deviation: e(t) =
.042097 |
| Std. Deviation: u(t) =
.021298 |
| Durbin-Watson:
u(t) =
1.125203 |
| Autocorrelation: u(t) =
.437399 |
| N[0,1] used for significance levels
|
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-11.38732107
.95549227 -11.918
.0000
LNPG
-.1523079877
.37052367E-01
-4.111
.0000
.67409429
LNI
1.266637673
.10730907
11.804
.0000
9.1109277
LNPNC
-.3084534704E-01
.12719693
-.243
.8084
.44319819
LNPUC
-.6380017910E-01 .75851491E-01
-.841
.4003
.66361220
RHO
.8625695910
.85519204E-01
10.086
.0000
(Note: E+nn or E-nn means multiply by 10 to + or -nn power.)
--> REGRESS;Lhs=LNG;Rhs=ONE,LNPG,LNI,LNPNC,LNPUC;Ar1;Alg=Corc;Maxit=1$
+---------------------------------------------+
| AR(1) Model:
e(t) = rho * e(t-1) + u(t) |
http://www.masil.org
http://www.joomok.org
Now, eliminate the Maxit=1 option to fit the iterative two-step Prais-Winsten and CochraneOrcutt models. LIMDEP produces estimates and standard errors that are slightly different from
those of STATA. LIMDEP needs a fewer iterations to reach convergence.
--> REGRESS;Lhs=LNG;Rhs=ONE,LNPG,LNI,LNPNC,LNPUC;Ar1$
+---------------------------------------------+
| AR(1) Model:
e(t) = rho * e(t-1) + u(t) |
| Initial value of rho
=
.69765 |
| Maximum iterations
=
100 |
| Method = Prais - Winsten
|
| Iter= 1, SS=
.014, Log-L= 89.845024 |
| Iter= 2, SS=
.012, Log-L= 92.830874 |
| Iter= 3, SS=
.011, Log-L= 93.363107 |
| Iter= 4, SS=
.011, Log-L= 93.338255 |
| Iter= 5, SS=
.011, Log-L= 93.305255 |
| Iter= 6, SS=
.011, Log-L= 93.292051 |
| Final value of Rho
=
.951197 |
| Iter= 6, SS=
.011, Log-L= 93.292051 |
| Durbin-Watson:
e(t) =
.097606 |
| Std. Deviation: e(t) =
.061276 |
| Std. Deviation: u(t) =
.018909 |
| Durbin-Watson:
u(t) =
1.555377 |
| Autocorrelation: u(t) =
.222311 |
| N[0,1] used for significance levels
|
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-9.618417704
1.1586795
-8.301
.0000
LNPG
-.2112382834
.34724610E-01
-6.083
.0000
.67409429
LNI
1.065917444
.12991909
8.204
.0000
9.1109277
LNPNC
.9701687217E-01
.12555264
.773
.4397
.44319819
LNPUC
-.3367703716E-01 .65148131E-01
-.517
.6052
.66361220
RHO
.9511970777
.52160225E-01
18.236
.0000
(Note: E+nn or E-nn means multiply by 10 to + or -nn power.)
--> REGRESS;Lhs=LNG;Rhs=ONE,LNPG,LNI,LNPNC,LNPUC;Ar1;Alg=Corc$
http://www.masil.org
http://www.joomok.org
+---------------------------------------------+
| AR(1) Model:
e(t) = rho * e(t-1) + u(t) |
| Initial value of rho
=
.69765 |
| Maximum iterations
=
100 |
| Method = Cochrane - Orcutt
|
| Iter= 1, SS=
.014, Log-L= 89.951767 |
| Iter= 2, SS=
.012, Log-L= 93.021836 |
| Iter= 3, SS=
.011, Log-L= 94.167826 |
| Iter= 4, SS=
.011, Log-L= 92.432530 |
| Final value of Rho
=
.945360 |
| Iter= 4, SS=
.011, Log-L= 92.432530 |
| Durbin-Watson:
e(t) =
.005738 |
| Std. Deviation: e(t) =
.057619 |
| Std. Deviation: u(t) =
.018785 |
| Durbin-Watson:
u(t) =
1.448556 |
| Autocorrelation: u(t) =
.275722 |
| N[0,1] used for significance levels
|
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-7.657883189
2.0205150
-3.790
.0002
LNPG
-.2242234551
.36380584E-01
-6.163
.0000
.67409429
LNI
.8659170265
.21323776
4.061
.0000
9.1109277
LNPNC
.7957307155E-01
.12510703
.636
.5248
.44319819
LNPUC
-.4109737743E-01 .65129565E-01
-.631
.5280
.66361220
RHO
.9453603504
.55108674E-01
17.154
.0000
(Note: E+nn or E-nn means multiply by 10 to + or -nn power.)
Let us fits the autocorrelation error model using the maximum likelihood algorithm. Compared
to SAS AUTOREG procedure, LIMDEP converges quickly and produces slightly different
estimates and standard errors.
--> REGRESS;Lhs=LNG;Rhs=ONE,LNPG,LNI,LNPNC,LNPUC;Ar1;Alg=MLE$
+-----------------------------------------------------------------------+
| Ordinary
least squares regression
Weighting variable = none
|
| Dep. var. = LNG
Mean= -.3708600000E-02, S.D.=
.1516908393
|
| Model size: Observations =
36, Parameters =
5, Deg.Fr.=
31 |
| Residuals: Sum of squares= .3383693649E-01, Std.Dev.=
.03304 |
| Fit:
R-squared= .957985, Adjusted R-squared =
.95256 |
| Model test: F[ 4,
31] = 176.71,
Prob value =
.00000 |
| Diagnostic: Log-L =
74.3732, Restricted(b=0) Log-L =
17.3181 |
|
LogAmemiyaPrCrt.=
-6.690, Akaike Info. Crt.=
-3.854 |
| Autocorrel: Durbin-Watson Statistic =
.60470,
Rho =
.69765 |
+-----------------------------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-12.34185146
.67489522 -18.287
.0000
LNPG
-.5909591880E-01 .32484970E-01
-1.819
.0786
.67409429
LNI
1.373400354
.75627733E-01
18.160
.0000
9.1109277
LNPNC
-.1267972409
.12699351
-.998
.3258
.44319819
LNPUC
-.1187078514
.81337098E-01
-1.459
.1545
.66361220
(Note: E+nn or E-nn means multiply by 10 to + or -nn power.)
+---------------------------------------------+
| AR(1) Model:
e(t) = rho * e(t-1) + u(t) |
| Initial value of rho
=
.69765 |
| Maximum iterations
=
100 |
| Method = Maximum likelihood
|
| Iter= 1, SS=
.014, Log-L= 89.845024 |
http://www.masil.org
http://www.joomok.org
| Iter= 2, SS=
.012, Log-L= 92.675210 |
| Iter= 3, SS=
.011, Log-L= 93.303814 |
| Iter= 4, SS=
.011, Log-L= 93.363749 |
| Iter= 5, SS=
.011, Log-L= 93.367649 |
| Final value of Rho
=
.930078 |
| Iter= 5, SS=
.011, Log-L= 93.367649 |
| Durbin-Watson:
e(t) =
.110756 |
| Std. Deviation: e(t) =
.051615 |
| Std. Deviation: u(t) =
.018961 |
| Durbin-Watson:
u(t) =
1.526119 |
| Autocorrelation: u(t) =
.236940 |
| N[0,1] used for significance levels
|
+---------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-9.764190340
1.1324911
-8.622
.0000
LNPG
-.2079613173
.34919931E-01
-5.955
.0000
.67409429
LNI
1.082832640
.12712938
8.518
.0000
9.1109277
LNPNC
.8779474079E-01
.12473030
.704
.4815
.44319819
LNPUC
-.3504838029E-01 .65860554E-01
-.532
.5946
.66361220
RHO
.9300777597
.62095632E-01
14.978
.0000
(Note: E+nn or E-nn means multiply by 10 to + or -nn power.)
Also LIMDEP supports the Hatanakas (1974)s autocorrelation error model with a lagged
dependent variable. The SAMPLE;2-36$ command specifies the observations to be used in
analysis.
--> CREATE; LNG1=LNG[-1]$
--> SAMPLE;2-36$
--> 2SLS;Lhs=LNG;
Rhs=ONE,LNG2,LNPG,LNI,LNPNC,LNPUC;
Inst=ONE,LNPG,LNI,LNPNC,PPT,PD;
Ar1;Hatanaka$
+-----------------------------------------------------------------------+
| Two stage
least squares regression
Weighting variable = none
|
| Dep. var. = LNG
Mean=
.5660128571E-02, S.D.=
.1429479338
|
| Model size: Observations =
35, Parameters =
6, Deg.Fr.=
29 |
| Residuals: Sum of squares= .2065570283E-01, Std.Dev.=
.02669 |
| Fit:
R-squared= .964118, Adjusted R-squared =
.95793 |
|
(Note: Not using OLS. R-squared is not bounded in [0,1] |
| Model test: F[ 5,
29] = 155.84,
Prob value =
.00000 |
| Diagnostic: Log-L =
80.4516, Restricted(b=0) Log-L =
18.9291 |
|
LogAmemiyaPrCrt.=
-7.089, Akaike Info. Crt.=
-4.254 |
| Autocorrel: Durbin-Watson Statistic =
1.83451,
Rho =
.08275 |
+-----------------------------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |b/St.Er.|P[|Z|>z] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
1.735962744
3.2268496
.538
.5906
LNG1
1.092342390
.23876226
4.575
.0000 -.73433543E-02
LNPG
-.1187551218
.29553512E-01
-4.018
.0001
.69558160
LNI
-.1873315634
.35787177
-.523
.6007
9.1225115
LNPNC
-.6036842439
.20357769
-2.965
.0030
.45460337
LNPUC
.4997800149
.18164139
2.751
.0059
.68769045
(Note: E+nn or E-nn means multiply by 10 to + or -nn power.)
+---------------------------------------------+
| AR(1) Model:
e(t) = rho * e(t-1) + u(t) |
| Initial value of rho
=
.08275 |
| Maximum iterations
=
100 |
| Method = Prais - Winsten
|
http://www.masil.org
http://www.joomok.org
http://www.masil.org
http://www.joomok.org
7. Conclusion
The autocorrelation coefficient of the model of U.S. gasoline consumption is .6744, which is
slightly different from D-W d-based coefficient and Theils adjustment (see Table 7.1).
There are various ways to test the first order autocorrelation. Table 7.1 summarizes test statistics.
D-W d, Breusch-Godfrey LM, Box-Pierce Q, and Ljung-Box Q all indicate an autoregressive
error in the model. The D-W d .6047 (36, 4) out of the bound from dL= 1.24 and dU 1.73 at the
.05 significance level. The Durbin h test for a model with a lagged dependent variable does not
reject the null hypothesis of no autocorrelation in the model with a lagged dependent variable.
All tests lead to the same conclusion. The LM test becomes a standard in econometrics.
Table 7.1 Comparison of Test Statistics for the First Order Autocorrelation
R1
R1 (DW d)
Theils R1
D-W d
Durbin h*
B-G LM
B-P Q
L-B Q
.67439496
.69765033
.58072899
.60469933
.95753197
(<.16915)
16.688194
(<.00004)
16.373108
(<.00005)
17.776517
(<.00003)
* The model includes a lagged dependent variable, omitting the first observation.
Table 7.2 summarizes FGLS estimators produced several methods excluding LIMDEP outputs.
The Prais-Winsten (Yule-Walker) estimators in SAS and STATA are the same with slightly
different goodness-of-fit statistics. You need to check the degrees of freedom for model and error
that are used in estimations. The iterative P-W two-step and the maximum likelihood methods
produce positive estimators for new car price index. Note that the Cochrane-Orcutt estimation
uses only 35 observations, excluding the first observation.
Table 7.2 Comparison of FGLS Estimators
OLS
N
Intercept
Gasoline
Income
New car
Used car
SSE
(dfe)
SEE*
SSM
(dfm)
F
R2
Adj. R2
Iteration
P-W
(OLS)
Y-W
(SAS)
P-W
(STATA)
36
Iterative
(STATA)
36
36
-11.49075
(.9391)
-.14638
(.0371)
1.27826
(.1055)
-.03988
(.1276)
-.06693
(.0766)
0.01445
(31)
-11.4907
(.9546)
-.1464
(.0377)
1.2783
(.1072)
-.0399
(.1297)
-.0669
(.0779)
0.01445
(30)
-11.4908
(.9391)
-.14638
(.0371)
1.27826
(.1055)
-.03989
(.1276)
-.06693
(.0766)
0.01445
(31)
-11.9537
(1.2499)
-.14264
(.0381)
1.32959
(.1396)
-.07936
(.1465)
-.05616
(.0798)
0.01430
(30)
-9.6703
(1.1670)
-.2101
(.0354)
1.0720
(.1309)
.0938
(.1273)
-.0341
(.0665)
0.01110
(30)
-9.66698
(1.1486)
-.21016
(.0348)
1.07159
(.1289)
.09397
(.1252)
-.03411
(.0654)
0.01110
(31)
-9.7543
(1.1530)
-.2082
(.0368)
1.0817
(.1294)
.0886
(.1268)
-.0349
(.0669)
0.01114
(30)
0.03304
0.77152
(4)
0.02159
0.13379
(5)
0.02195
-
0.02159
0.13335
(4)
0.02183
0.07005
(4)
0.01923
-
0.01892
0.04459
(4)
0.01927
-
176.71
(<.0000)
0.9580
0.9526
N/A
57.39
(<.0000)
0.9025
0.8868
1
71.50
(<.0000)
0.9022
0.8896
1
36.74
(<.0000)
0.8305
0.8079
1
0.8093
7
36
MLE
(SAS)
36
0.9019
1
35
Iterative**
(SAS)
-12.34184
(.6749)
-.05910
(.0325)
1.3734
(.0756)
-.12680
(.1270)
-.11871
(.0813)
0.03384
(31)
36
C-O
(STATA)
31.14
(<.0000)
0.8007
0.7750
16
36
0.8147
35
* MSE
** Iterative Prais-Winsten (Yule-Walker) two-step estimation is used.
* The autocorrelation coefficient is used as the estimator in all FGLS.
http://www.masil.org
http://www.joomok.org
References
Box, George E. P., and David A. Pierce. 1970. "Distribution of Residual Autocorrelations in
Autoregressive-Integrated Moving Average Time Series Models." Journal of the
American Statistical Association, 65(332):1509-1526.
Breusch, Trevor S. 1978. "Testing for Autocorrelation in Dynamic Linear Models." Australian
Economic Papers, 17(31):334-335.
Cochrane, D., and G. H. Orcutt. 1949. "Application of Least Squares Regression to Relationships
Containing Autocorrelated Error Terms." Journal of the American Statistical
Association, 44(245):32-61.
Durbin, J. 1970. "Testing for Serial Correlation in Least-Squares Regression When Some of the
Regressors are Lagged Dependent Variables." Econometrica, 38(3):410-421.
Durbin, J., and G. S. Watson. 1950. "Testing for Serial Correlation in Least Squares Regression
I." Biometrika, 37(3/4):409-428 and 1951, 38(1/2):177-178.
Durbin, J., and G. S. Watson. 1971. "Testing for Serial Correlation in Least Squares Regression
III." Biometrika, 58(1):1-19.
Godfrey, L. G. 1978. "Testing Against General Autoregressive and Moving Average Error
Models when the Regressors Include Lagged Dependent Variables."
Econometrica, 46(6):1293-1301.
Greene, William H. 2002. LIMDEP Version 8.0 Econometric Modeling Guide, 4th ed. Plainview,
New York: Econometric Software.
Greene, William H. 2003. Econometric Analysis, 5th ed. Upper Saddle River, NJ: Prentice Hall.
Hatanaka, Michio. 1974. "An Efficient Two-Step Estimator for the Dynamic Adjustment Model
with Autocorrelated Errors." Journal of Econometrics, 2(3):199-220.
Ljung, Greta M., and George E. P. Box. 1978. "On a Measure of Lack of Fit in Time Series
Models." Biometrika, 65(2):297-303.
Prais, Sigbert J., and Christopher B. Winsten. 1954. Trend Estimators and Serial Correlation.
Cowles Commission Discussion Paper N. 383, Chicago.
SAS Institute. 2004. SAS/ETS User's Guide. Cary, NC: SAS Institute.
STATA Press. 2005. STATA Time-Series Reference Manual, Release 9. College Station, TX:
STATA Press.
Theil, Henri. 1971. Principles of Econometrics. New York: Wiley.
http://www.masil.org
http://www.joomok.org