SHAZAM Estimation with AR(1) Errors

Estimation with AR(1) Errors


The previous example found evidence for autocorrelated errors within the cross-section units. The AR1 option on the POOL command will transform the observations to correct for AR(1) errors. OLS is then applied to the transformed observations.

The transformed model may feature heteroskedasticity. Therefore, it may be of interest to obtain heteroskedasticity consistent standard errors. The HETCOV option can be used to compute the panel-corrected standard errors proposed by Beck and Katz [1995].

When the AR1 option is used the following options are also available:

CORCOEF For each cross-section, estimate the autoregressive parameter as the sample correlation coefficient between the OLS residuals and the 1-period lagged residuals. This method guarantees an estimate in the interval [-1, 1].
SAME Assume the same autoregressive coefficient for all cross-sections. Beck and Katz [1995] discuss that imposing the same autoregressive parameter for the cross-section units is in the same spirit as imposing common slope parameters for the cross-sections.

The SHAZAM commands (filename: FIRMAR1.SHA) below estimate the investment demand equation assuming that the errors in each cross-section follow an AR(1) process. On the POOL command the SAME option is used to impose the same autoregressive coefficient for all cross-sections. The HETCOV option is used to obtain the panel-corrected standard errors.

SAMPLE 1 20
READ(FIRM1.txt) YEAR IGM FGM CGM ICHR FCHR CCHR / SKIPLINES=1
READ(FIRM2.txt) YEAR IGE FGE CGE IWH FWH CWH / SKIPLINES=1
READ(FIRM3.txt) YEAR IUS FUS CUS  / SKIPLINES=1
* Stack the data
MATRIX I=(IGM'|ICHR'|IGE'|IWH'|IUS')'
MATRIX F=(FGM'|FCHR'|FGE'|FWH'|FUS')'
MATRIX C=(CGM'|CCHR'|CGE'|CWH'|CUS')'

SAMPLE 1 100
* Create cross-section dummy variables.
*  Set the number of cross-sections
GEN1 NC=5
MATRIX CSDUM=SEAS(100,-NC)
DO #=1,NC
 GENR D#=CSDUM:#
ENDO

* Pooling with AR1 errors and Panel-Corrected Covariance Matrix
POOL I F C D1-D5 / NOCONSTANT NCROSS=5 AR1 SAME HETCOV 
* Test for equality of firm intercepts
TEST
  TEST D1=D2
  TEST D1=D3
  TEST D1=D4
  TEST D1=D5
END
STOP

The SHAZAM output can be viewed.


Home [SHAZAM Guide home]

SHAZAM output


|_SAMPLE 1 20
|_READ(FIRM1.txt) YEAR IGM FGM CGM ICHR FCHR CCHR / SKIPLINES=1
UNIT 88 IS NOW ASSIGNED TO: FIRM1.txt
   7 VARIABLES AND       20 OBSERVATIONS STARTING AT OBS       1

|_READ(FIRM2.txt) YEAR IGE FGE CGE IWH FWH CWH / SKIPLINES=1
UNIT 88 IS NOW ASSIGNED TO: FIRM2.txt
   7 VARIABLES AND       20 OBSERVATIONS STARTING AT OBS       1

|_READ(FIRM3.txt) YEAR IUS FUS CUS  / SKIPLINES=1
UNIT 88 IS NOW ASSIGNED TO: FIRM3.txt
   4 VARIABLES AND       20 OBSERVATIONS STARTING AT OBS       1

|_* Stack the data
|_MATRIX I=(IGM'|ICHR'|IGE'|IWH'|IUS')'
|_MATRIX F=(FGM'|FCHR'|FGE'|FWH'|FUS')'
|_MATRIX C=(CGM'|CCHR'|CGE'|CWH'|CUS')'

|_SAMPLE 1 100
|_* Create cross-section dummy variables.
|_*  Set the number of cross-sections
|_GEN1 NC=5
|_MATRIX CSDUM=SEAS(100,-NC)
|_DO #=1,NC
|_ GENR D#=CSDUM:#
|_ENDO
 _DO #=1,NC
****** EXECUTION BEGINNING FOR DO LOOP  # =       1
#_         GENR D1=CSDUM:1
#_        ENDO
#_         GENR D2=CSDUM:2
#_        ENDO
#_         GENR D3=CSDUM:3
#_        ENDO
#_         GENR D4=CSDUM:4
#_        ENDO
#_         GENR D5=CSDUM:5
#_        ENDO
****** EXECUTION FINISHED FOR DO LOOP  #=       5

|_* Pooling with AR1 errors and Panel-Corrected Covariance Matrix
|_POOL I F C D1-D5 / NOCONSTANT NCROSS=5 AR1 SAME HETCOV

POOLED CROSS-SECTION TIME-SERIES ESTIMATION
   100 TOTAL OBSERVATIONS
     5 CROSS-SECTIONS
    20 TIME-PERIODS

DEPENDENT VARIABLE = I

MODEL ASSUMPTIONS:
    SAME ESTIMATED RHO FOR EACH CROSS-SECTION

OLS COEFFICIENTS
  0.10598      0.34666      -76.067      -29.374      -242.17
  -57.899       92.539

USING PANEL-CORRECTED COVARIANCE MATRIX

RHO VECTOR
  0.62657     -0.47882E-01  0.85293      0.86680      0.51239

SAME ESTIMATED RHO FOR ALL CROSS-SECTIONS =  0.60606

BUSE [1973] R-SQUARE = 0.8436      BUSE RAW-MOMENT R-SQUARE = 0.9033
VARIANCE OF THE ESTIMATE-SIGMA**2 =   3186.3
STANDARD ERROR OF THE ESTIMATE-SIGMA =   56.447
SUM OF SQUARED ERRORS-SSE=  0.29632E+06
MEAN OF DEPENDENT VARIABLE =   248.96
LOG OF THE LIKELIHOOD FUNCTION = -542.740

VARIABLE   ESTIMATED  STANDARD   T-RATIO        PARTIAL STANDARDIZED ELASTICITY
  NAME    COEFFICIENT   ERROR      93 DF   P-VALUE CORR. COEFFICIENT  AT MEANS
F         0.90932E-01 0.1445E-01   6.291     0.000 0.546     0.4823     0.7021
C         0.36095     0.4002E-01   9.019     0.000 0.683     0.5007     0.4510
D1        -3.3596      73.61     -0.4564E-01 0.964-0.005    -0.0050    -0.0027
D2        -20.763      13.03      -1.594     0.114-0.163    -0.0312    -0.0167
D3        -222.24      37.69      -5.897     0.000-0.522    -0.3335    -0.1785
D4        -50.604      13.49      -3.751     0.000-0.363    -0.0759    -0.0407
D5         108.32      53.42       2.028     0.045 0.206     0.1626     0.0870

|_* Test for equality of firm intercepts
|_TEST
|_  TEST D1=D2
|_  TEST D1=D3
|_  TEST D1=D4
|_  TEST D1=D5
|_END
F STATISTIC =   27.464480     WITH    4 AND   93 D.F.  P-VALUE= 0.00000
WALD CHI-SQUARE STATISTIC =   109.85792     WITH    4 D.F.  P-VALUE= 0.00000
UPPER BOUND ON P-VALUE BY CHEBYCHEV INEQUALITY = 0.03641
|_STOP

Home [SHAZAM Guide home]