ECON 399 - A1
Lab Assignment #8
(based on Lab #9 in Manual)
Name _____Answers______________ Lab Section (circle one) D1 (11 am) D2 (1 pm)
Student id ______________________
(1) Download the time series data set ‘Lab1.txt’ from
http://www.ualberta.ca/~deyoung/Econ399
(Instructions for downloading the file are in the Appendix of the Lab Manual).
(2) Write a Shazam program that
(i) reads in all observations from the data set;
(ii) generates a set of monthly dummy variables (M1=January, M2, M3, etc.);
(iii) generates the 3 month lag of the real price of oil (rproil3) for as many
observations as possible;
(iv) runs an OLS regression with the not seasonally adjusted unemployment rate
for Alberta, unABnsa, as the dependent variable and rproil3, the exchange
rate, the prime interest rate and M1 through M11 as the explanatory variables
for all usable observations;
(v) performs a Durbin-Watson test for 1st order autocorrelation
(vi) performs a Breusch-Godfrey test for 3rd order autocorrelation;
(3) Use the results from your Shazam output to complete the following:
The Durbin-Watson test statistic for (v) is: 0.43528.
For α = .05 we would reject/not reject (circle one) the null hypothesis of no correlation between
error terms that are one month apart.
The Breusch-Godfrey test statistic for (vi) is: ___87.48864___.
It has a χ2 distribution with ____3______ degrees of freedom.
For α = .05, we would reject/not reject (circle one) the null hypothesis of no 3rd order
autocorrelation.
NOTE: Examination of the coefficients in the auxiliary regression for the BG test indicates that
the result is being driven by the 1st lag.
ALSO NOTE that on some SHAZAM set-ups, the default for missing values is not zero. In such
cases the commands highlighted in yellow on the attached command file are needed.
SHAZAM COMMAND FILE
READ(c:\Econ399F08\Lab1.txt) Date OilPr UnONsa UnONnsa UnABsa UnABnsa cpi &
exrate bankrate prime / skiplines=1
* check for obvious errors
* in reading the data set
STAT / ALL
* generate monthly 'seasonal' dummies
matrix seasdv=seas(150,12)
copy seasdv:1 m1
copy seasdv:2 m2
copy seasdv:3 m3
copy seasdv:4 m4
copy seasdv:5 m5
copy seasdv:6 m6
copy seasdv:7 m7
copy seasdv:8 m8
copy seasdv:9 m9
copy seasdv:10 m10
copy seasdv:11 m11
copy seasdv:12 m12
* convert nominal oil prices to real oil prices
genr roilpr = 100*oilpr/cpi
* generate the three-month lag of the oil price
genr rproil3= roilpr(-3)
* estimate model
* our data set does not have 3-month lagged oil prices for our first
* three observations, so we adjust the sample for estimation
smpl 4 150
* use dwpvalue option to get the our durbin-watson test information
ols unabnsa rproil3 exrate prime m1-m11 / dwpvalue
* breusch-godfrey test
ols unabnsa rproil3 exrate prime m1-m11 / resid=e
genr elag1=lag(e,1)
genr elag2=lag(e,2)
genr elag3=lag(e,3)
smpl 4 4
genr elag1=0
smpl 4 5
genr elag2=0
smpl 4 6
genr elag3=0
smpl 4 150
stat e elag1 elag2 elag3 rproil3 exrate prime m1-m11
ols e elag1 elag2 elag3 rproil3 exrate prime m1-m11
gen1 bg=$n*$r2
print bg
stop
end
|_READ (c:\Econ399F08\Lab1.txt) Date OilPr UnONsa UnONnsa UnABsa UnABnsa cpi exrate
bankrate prime / skiplines=1
UNIT 88 IS NOW ASSIGNED TO: c:\Econ399F08\Lab1.txt
...SAMPLE RANGE IS NOW SET TO: 1 150
|_* check for obvious errors
|_* in reading the data set
|_STAT / ALL
NAME N MEAN ST. DEV VARIANCE MINIMUM MAXIMUM
DATE 150 2001.8 3.6244 13.136 1996.0 2008.1
OILPR 150 37.758 24.049 578.34 10.310 132.04
UNONSA 150 6.9113 0.92689 0.85913 5.4000 9.3000
UNONNSA 150 6.9133 1.0585 1.1204 4.9000 9.8000
UNABSA 150 4.9033 1.0505 1.1035 3.0000 7.5000
UNABNSA 150 4.9080 1.1237 1.2626 2.8000 8.1000
CPI 150 99.855 7.8095 60.988 88.000 115.40
EXRATE 150 1.3558 0.17239 0.29717E-01 0.96712 1.6003
BANKRATE 150 4.0175 1.0896 1.1872 2.2500 6.0000
PRIME 150 3.9079 1.1144 1.2419 2.0500 5.9800
|_* generate monthly 'seasonal' dummies
|_matrix seasdv=seas(150,12)
|_copy seasdv:1 m1
|_copy seasdv:2 m2
|_copy seasdv:3 m3
|_copy seasdv:4 m4
|_copy seasdv:5 m5
|_copy seasdv:6 m6
|_copy seasdv:7 m7
|_copy seasdv:8 m8
|_copy seasdv:9 m9
|_copy seasdv:10 m10
|_copy seasdv:11 m11
|_copy seasdv:12 m12
|_* convert nominal oil prices to real oil prices
|_genr roilpr = 100*oilpr/cpi
|_* generate the three-month lag of the oil price
|_genr rproil3= roilpr(-3)
..NOTE.LAG VALUE IN UNDEFINED OBSERVATIONS SET TO ZERO
|_* estimate model
|_* our data set does not have 3-month lagged oil prices for our first
|_* three observations, so we adjust the sample for estimation
|_smpl 4 150
|_* use dwpvalue option to get the our durbin-watson test information
|_ols unabnsa rproil3 exrate prime m1-m11 / dwpvalue
147 OBSERVATIONS DEPENDENT VARIABLE= UNABNSA
...NOTE..SAMPLE RANGE SET TO: 4, 150
DURBIN-WATSON STATISTIC = 0.43528
DURBIN-WATSON POSITIVE AUTOCORRELATION TEST P-VALUE = 0.000000
NEGATIVE AUTOCORRELATION TEST P-VALUE = 1.000000
R-SQUARE = 0.7181 R-SQUARE ADJUSTED = 0.6882
VARIANCE OF THE ESTIMATE-SIGMA**2 = 0.34653
STANDARD ERROR OF THE ESTIMATE-SIGMA = 0.58867
SUM OF SQUARED ERRORS-SSE= 45.742
MEAN OF DEPENDENT VARIABLE = 4.8490
LOG OF THE LIKELIHOOD FUNCTION = -122.778
VARIABLE ESTIMATED STANDARD T-RATIO PARTIAL STANDARDIZED ELASTICITY
NAME COEFFICIENT ERROR 132 DF P-VALUE CORR. COEFFICIENT AT MEANS
RPROIL3 -0.57471E-01 0.5737E-02 -10.02 0.000-0.657 -0.9654 -0.4151
EXRATE -1.2307 0.5819 -2.115 0.036-0.181 -0.2033 -0.3440
PRIME 0.33241E-01 0.4422E-01 0.7518 0.454 0.065 0.0350 0.0266
M1 0.74321 0.2404 3.092 0.002 0.260 0.1937 0.0125
M2 0.37278 0.2404 1.551 0.123 0.134 0.0971 0.0063
M3 0.23316 0.2406 0.9692 0.334 0.084 0.0608 0.0039
M4 0.50331 0.2359 2.134 0.035 0.183 0.1360 0.0092
M5 0.46714 0.2361 1.978 0.050 0.170 0.1262 0.0085
M6 -0.88843E-01 0.2359 -0.3766 0.707-0.033 -0.0240 -0.0016
M7 0.51723 0.2410 2.146 0.034 0.184 0.1348 0.0087
M8 0.65581 0.2407 2.725 0.007 0.231 0.1709 0.0110
M9 -0.13833 0.2407 -0.5747 0.566-0.050 -0.0360 -0.0023
M10 0.21665E-01 0.2405 0.9010E-01 0.928 0.008 0.0056 0.0004
M11 0.23382 0.2404 0.9728 0.332 0.084 0.0609 0.0039
CONSTANT 8.1074 1.010 8.030 0.000 0.573 0.0000 1.6720
|_* breusch-godfrey test
|_ols unabnsa rproil3 exrate prime m1-m11 / resid=e
147 OBSERVATIONS DEPENDENT VARIABLE= UNABNSA
...NOTE..SAMPLE RANGE SET TO: 4, 150
R-SQUARE = 0.7181 R-SQUARE ADJUSTED = 0.6882
VARIANCE OF THE ESTIMATE-SIGMA**2 = 0.34653
STANDARD ERROR OF THE ESTIMATE-SIGMA = 0.58867
SUM OF SQUARED ERRORS-SSE= 45.742
MEAN OF DEPENDENT VARIABLE = 4.8490
LOG OF THE LIKELIHOOD FUNCTION = -122.778
VARIABLE ESTIMATED STANDARD T-RATIO PARTIAL STANDARDIZED ELASTICITY
NAME COEFFICIENT ERROR 132 DF P-VALUE CORR. COEFFICIENT AT MEANS
RPROIL3 -0.57471E-01 0.5737E-02 -10.02 0.000-0.657 -0.9654 -0.4151
EXRATE -1.2307 0.5819 -2.115 0.036-0.181 -0.2033 -0.3440
PRIME 0.33241E-01 0.4422E-01 0.7518 0.454 0.065 0.0350 0.0266
M1 0.74321 0.2404 3.092 0.002 0.260 0.1937 0.0125
M2 0.37278 0.2404 1.551 0.123 0.134 0.0971 0.0063
M3 0.23316 0.2406 0.9692 0.334 0.084 0.0608 0.0039
M4 0.50331 0.2359 2.134 0.035 0.183 0.1360 0.0092
M5 0.46714 0.2361 1.978 0.050 0.170 0.1262 0.0085
M6 -0.88843E-01 0.2359 -0.3766 0.707-0.033 -0.0240 -0.0016
M7 0.51723 0.2410 2.146 0.034 0.184 0.1348 0.0087
M8 0.65581 0.2407 2.725 0.007 0.231 0.1709 0.0110
M9 -0.13833 0.2407 -0.5747 0.566-0.050 -0.0360 -0.0023
M10 0.21665E-01 0.2405 0.9010E-01 0.928 0.008 0.0056 0.0004
M11 0.23382 0.2404 0.9728 0.332 0.084 0.0609 0.0039
CONSTANT 8.1074 1.010 8.030 0.000 0.573 0.0000 1.6720
|_genr elag1=lag(e,1)
..NOTE.LAG VALUE IN UNDEFINED OBSERVATIONS SET TO ZERO
|_genr elag2=lag(e,2)
..NOTE.LAG VALUE IN UNDEFINED OBSERVATIONS SET TO ZERO
|_genr elag3=lag(e,3)
..NOTE.LAG VALUE IN UNDEFINED OBSERVATIONS SET TO ZERO
|_smpl 4 4
|_genr elag1=0
|_smpl 4 5
|_genr elag2=0
|_smpl 4 6
|_genr elag3=0
|_smpl 4 150
|_stat e elag1 elag2 elag3 rproil3 exrate prime m1-m11
NAME N MEAN ST. DEV VARIANCE MINIMUM MAXIMUM
E 147 0.11208E-14 0.55973 0.31330 -1.0922 1.6847
ELAG1 147 -0.85487E-02 0.54992 0.30241 -1.0922 1.6847
ELAG2 147 -0.15402E-01 0.54341 0.29529 -1.0922 1.6847
ELAG3 147 -0.19837E-01 0.54058 0.29222 -1.0922 1.6847
RPROIL3 147 35.019 17.709 313.61 11.292 92.753
EXRATE 147 1.3555 0.17414 0.30324E-01 0.96712 1.6003
PRIME 147 3.8813 1.1098 1.2316 2.0500 5.9800
M1 147 0.81633E-01 0.27474 0.75482E-01 0.0000 1.0000
M2 147 0.81633E-01 0.27474 0.75482E-01 0.0000 1.0000
M3 147 0.81633E-01 0.27474 0.75482E-01 0.0000 1.0000
M4 147 0.88435E-01 0.28490 0.81167E-01 0.0000 1.0000
M5 147 0.88435E-01 0.28490 0.81167E-01 0.0000 1.0000
M6 147 0.88435E-01 0.28490 0.81167E-01 0.0000 1.0000
M7 147 0.81633E-01 0.27474 0.75482E-01 0.0000 1.0000
M8 147 0.81633E-01 0.27474 0.75482E-01 0.0000 1.0000
M9 147 0.81633E-01 0.27474 0.75482E-01 0.0000 1.0000
M10 147 0.81633E-01 0.27474 0.75482E-01 0.0000 1.0000
M11 147 0.81633E-01 0.27474 0.75482E-01 0.0000 1.0000
|_ols e elag1 elag2 elag3 rproil3 exrate prime m1-m11
REQUIRED MEMORY IS PAR= 73 CURRENT PAR= 2000
OLS ESTIMATION
147 OBSERVATIONS DEPENDENT VARIABLE= E
...NOTE..SAMPLE RANGE SET TO: 4, 150
R-SQUARE = 0.5952 R-SQUARE ADJUSTED = 0.5418
VARIANCE OF THE ESTIMATE-SIGMA**2 = 0.14355
STANDARD ERROR OF THE ESTIMATE-SIGMA = 0.37888
SUM OF SQUARED ERRORS-SSE= 18.518
MEAN OF DEPENDENT VARIABLE = 0.11208E-14
LOG OF THE LIKELIHOOD FUNCTION = -56.3148
VARIABLE ESTIMATED STANDARD T-RATIO PARTIAL STANDARDIZED ELASTICITY
NAME COEFFICIENT ERROR 129 DF P-VALUE CORR. COEFFICIENT AT MEANS
ELAG1 0.72930 0.8819E-01 8.269 0.000 0.589 0.7165***********
ELAG2 0.52355E-02 0.1092 0.4796E-01 0.962 0.004 0.0051***********
ELAG3 0.88826E-01 0.9009E-01 0.9860 0.326 0.086 0.0858***********
RPROIL3 0.30455E-02 0.3735E-02 0.8154 0.416 0.072 0.0964***********
EXRATE 0.15165 0.3755 0.4038 0.687 0.036 0.0472***********
PRIME 0.12293E-01 0.2854E-01 0.4307 0.667 0.038 0.0244***********
M1 0.21132E-02 0.1547 0.1366E-01 0.989 0.001 0.0010***********
M2 0.33791E-02 0.1547 0.2184E-01 0.983 0.002 0.0017***********
M3 0.58728E-02 0.1548 0.3793E-01 0.970 0.003 0.0029***********
M4 0.49872E-02 0.1518 0.3285E-01 0.974 0.003 0.0025***********
M5 0.54906E-02 0.1520 0.3613E-01 0.971 0.003 0.0028***********
M6 0.13475E-02 0.1518 0.8874E-02 0.993 0.001 0.0007***********
M7 0.90654E-01 0.1553 0.5838 0.560 0.051 0.0445***********
M8 0.14673E-01 0.1553 0.9450E-01 0.925 0.008 0.0072***********
M9 0.16175E-01 0.1553 0.1042 0.917 0.009 0.0079***********
M10 0.42905E-02 0.1548 0.2772E-01 0.978 0.002 0.0021***********
M11 0.19898E-02 0.1547 0.1286E-01 0.990 0.001 0.0010***********
CONSTANT -0.36426 0.6532 -0.5577 0.578-0.049 0.0000***********
|_gen1 bg=$n*$r2
..NOTE..CURRENT VALUE OF $N = 147.00
..NOTE..CURRENT VALUE OF $R2 = 0.59516
|_print bg
BG
87.48864
|_stop
TYPE COMMAND