Download Answers5.qoc

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Department of Economics
ECONOMETRICS I
Fall 2007 – Tuesday, Thursday, 1:00 – 2:20
Professor William Greene
Phone: 212.998.0876
Office: KMC 7-78
Home page:ww.stern.nyu.edu/~wgreene
Office Hours: Open
Email: [email protected]
URL for course web page:
www.stern.nyu.edu/~wgreene/Econometrics/Econometrics.htm
Assignment 5
Hypothesis Tests and Prediction
1. The following exercises use the gasoline data which we have used at various points before. All
variables in all regressions discussed below are assumed to be logarithms. As such, in the results to follow,
all estimated coefficients are estimates of elasticities. In the following, g = log(100000*GasQ/Pop), Pg =
log(GasP), y=log(PCIncome), etc.
a.
The correlation of g and pg is positive. In the regression of g on a constant term, pg and y, the
slope on pg is negative. Obtain the empirical values of these two coefficients, then reconcile the
numerical results (i.e., explain how this result arises).
+----------------------------------------------------+
| Ordinary
least squares regression
|
| Model was estimated Dec 09, 2005 at 03:33:16PM
|
| LHS=G
Mean
=
3.309784
|
|
Standard deviation
=
.2384918
|
| WTS=none
Number of observs.
=
52
|
| Model size
Parameters
=
3
|
|
Degrees of freedom
=
49
|
| Residuals
Sum of squares
=
.1768978
|
|
Standard error of e =
.6008459E-01 |
| Fit
R-squared
=
.9390175
|
|
Adjusted R-squared
=
.9365284
|
| Model test
F[ 2,
49] (prob) = 377.25 (.0000) |
| Diagnostic
Log likelihood
=
73.98430
|
|
Restricted(b=0)
=
1.257919
|
|
Chi-sq [ 2] (prob) = 145.45 (.0000) |
| Info criter. LogAmemiya Prd. Crt. = -5.567914
|
|
Akaike Info. Criter. = -5.568042
|
| Autocorrel
Durbin-Watson Stat. =
.0875278
|
|
Rho = cor[e,e(-1)]
=
.9562361
|
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-5.42315723
.58200599
-9.318
.0000
PG
-.17124062
.03788798
-4.520
.0000
3.72930296
Y
.96864830
.07376161
13.132
.0000
9.67487347
This is an application of the “left out variable” result. The partial correlation between logG and logPG is
negative when logY is included in the equation.
b.
Consider a nonlinear regression model of the form g = 1 + 2pg + 3y + 4y2 +. Use linear least
squares to estimate the coefficients of the model. The marginal effect of y on E[g|pg,y] is
E[g| pg,y]/y = 3 + 24y,
which depends on y. Form a confidence interval for this marginal effect at income = PCIncome =
$27,208 (log = 10.2113, the 2004 value). [Note, the estimate is of the form w1b3 + w2b4 where
w1=1 and w2=log(40).] You will need to estimate the variance of this statistic using your
regression results. (If you are using LIMDEP, include ;PRINTVC in your regression command to
display the matrix you need. You can access this matrix from the project window in the Matrices
list – it is VARB. If you are using some other program, use whatever command you need to
display the covariance matrix for your regression coefficient estimates.)
+----------------------------------------------------+
| Ordinary
least squares regression
|
| Model was estimated Dec 09, 2005 at 03:34:01PM
|
| LHS=G
Mean
=
3.309784
|
|
Standard deviation
=
.2384918
|
| WTS=none
Number of observs.
=
52
|
| Model size
Parameters
=
4
|
|
Degrees of freedom
=
48
|
| Residuals
Sum of squares
=
.4212751E-01 |
|
Standard error of e =
.2962527E-01 |
| Fit
R-squared
=
.9854773
|
|
Adjusted R-squared
=
.9845696
|
| Model test
F[ 3,
48] (prob) =1085.72 (.0000) |
| Diagnostic
Log likelihood
=
111.2909
|
|
Restricted(b=0)
=
1.257919
|
|
Chi-sq [ 3] (prob) = 220.07 (.0000) |
| Info criter. LogAmemiya Prd. Crt. = -6.964147
|
|
Akaike Info. Criter. = -6.964452
|
| Autocorrel
Durbin-Watson Stat. =
.2957574
|
|
Rho = cor[e,e(-1)]
=
.8521213
|
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-51.7745363
3.75147646
-13.801
.0000
PG
-.12775157
.01900782
-6.721
.0000
3.72930296
Y
10.6526137
.78232692
13.617
.0000
9.67487347
Y2
-.50683621
.04090090
-12.392
.0000
93.7224759
Matrix Cov.Mat. has 4 rows and 4 columns.
1
2
3
4
+-------------------------------------------------------1|
14.07358
-.00822
-2.93352
.15299
2|
-.00822
.00036
.00210
-.00014
3|
-2.93352
.00210
.61204
-.03196
4|
.15299
-.00014
-.03196
.00167
-->
-->
-->
-->
-->
-->
calc;y2004=10.2113$
calc;me=b(3)+2*b(4)*y2004 $
calc;twoY=2*y2004$
matr;gme=[0,0,1,twoy]$
matr;vme=gme*varb*gme'$
calc;list;sdme=sqr(vme);lower=me-1.96*sdme;upper=me+1.96*sdme$
SDME
= .64957406920785750D-01
LOWER
= .17438393601108600D+00
UPPER
= .42901697114056610D+00
c.
Use an F test to test the hypothesis that the three macroeconomic price indexes, PN, PD, PS
(remember to take logs) do not have a significant influence on g.
--> crea;lpd=log(pd);lpn=log(pn);lps=log(ps)$
--> regr;lhs=g;rhs=one,pg,y$
+----------------------------------------------------+
| Ordinary
least squares regression
|
| Model was estimated Dec 09, 2005 at 03:40:10PM
|
| LHS=G
Mean
=
3.309784
|
|
Standard deviation
=
.2384918
|
| WTS=none
Number of observs.
=
52
|
| Model size
Parameters
=
3
|
|
Degrees of freedom
=
49
|
| Residuals
Sum of squares
=
.1768978
|
|
Standard error of e =
.6008459E-01 |
| Fit
R-squared
=
.9390175
|
|
Adjusted R-squared
=
.9365284
|
| Model test
F[ 2,
49] (prob) = 377.25 (.0000) |
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-5.42315723
.58200599
-9.318
.0000
PG
-.17124062
.03788798
-4.520
.0000
3.72930296
Y
.96864830
.07376161
13.132
.0000
9.67487347
--> calc;ss0=sumsqdev$
--> regr;lhs=g;rhs=one,pg,y,lpn,lpd,lps$
+----------------------------------------------------+
| Ordinary
least squares regression
|
| Model was estimated Dec 09, 2005 at 03:40:10PM
|
| LHS=G
Mean
=
3.309784
|
|
Standard deviation
=
.2384918
|
| WTS=none
Number of observs.
=
52
|
| Model size
Parameters
=
6
|
|
Degrees of freedom
=
46
|
| Residuals
Sum of squares
=
.6931595E-01 |
|
Standard error of e =
.3881840E-01 |
| Fit
R-squared
=
.9761045
|
|
Adjusted R-squared
=
.9735072
|
| Model test
F[ 5,
46] (prob) = 375.81 (.0000) |
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-11.5868243
.86301823
-13.426
.0000
PG
-.00010939
.06072810
-.002
.9986
3.72930296
Y
1.66842867
.09644870
17.299
.0000
9.67487347
LPN
-.14775813
.25408578
-.582
.5637
4.23689080
LPD
.38989123
.10278846
3.793
.0004
4.23906603
LPS
-.54403942
.14749686
-3.688
.0006
4.17535768
--> calc;ss1=sumsqdev$
--> calc;list;f=((ss0-ss1)/2)/(ss1/(n-6))$
F
= .35697146682999960D+02
This F value is statistically significant at any level. The null hypothesis would be rejected.
d.
Use an F test to test the hypothesis that the coefficient on the log of the price of gasoline changed
in 1974 while all other coefficients in the model were unchanged. Retain the three
macroeconomic price indices in your equation.
--> calc;ss1=sumsqdev$
--> calc;list;f=((ss0-ss1)/2)/(ss1/(n-6))$
F
= .35697146682999960D+02
--> crea;post73 = (year > 1973) ; pgpost=pg*post73$
--> regr;lhs=g;rhs=one,pg,y,lpn,lpd,lps,pgpost $
+----------------------------------------------------+
| Ordinary
least squares regression
|
| Model was estimated Dec 09, 2005 at 03:44:41PM
|
| LHS=G
Mean
=
3.309784
|
|
Standard deviation
=
.2384918
|
| WTS=none
Number of observs.
=
52
|
| Model size
Parameters
=
7
|
|
Degrees of freedom
=
45
|
| Residuals
Sum of squares
=
.6492501E-01 |
|
Standard error of e =
.3798392E-01 |
| Fit
R-squared
=
.9776182
|
|
Adjusted R-squared
=
.9746340
|
| Model test
F[ 6,
45] (prob) = 327.59 (.0000) |
| Diagnostic
Log likelihood
=
100.0451
|
|
Restricted(b=0)
=
1.257919
|
|
Chi-sq [ 6] (prob) = 197.57 (.0000) |
| Info criter. LogAmemiya Prd. Crt. = -6.414891
|
|
Akaike Info. Criter. = -6.416535
|
| Autocorrel
Durbin-Watson Stat. =
.4675473
|
|
Rho = cor[e,e(-1)]
=
.7662264
|
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-10.4420717
1.06944563
-9.764
.0000
PG
-.01819773
.06032044
-.302
.7643
3.72930296
Y
1.60143627
.10188899
15.717
.0000
9.67487347
LPN
-.46157859
.30687690
-1.504
.1395
4.23689080
LPD
.33622707
.10517773
3.197
.0025
4.23906603
LPS
-.28821546
.20575297
-1.401
.1681
4.17535768
PGPOST
.02365052
.01355694
1.745
.0879
2.52846745
--> calc;ss2=sumsqdev
;list;fpost=((ss1-ss2)/1)/(ss2/(n-7))$
FPOST
= .30433917587987170D+01
The F is not significant – the P value is .0879.
statistic in the regression results.
e.
Note that F is the square of the t
Continuing part d, test the hypothesis that the entire model shifted in 1974, i.e., that entirely
different regression models applied before 1974 and from 1974 onward. Use a Chow test.
--> Sample ; 1 - 52 $
--> regr;lhs=g;rhs=one,pg,y,lpn,lpd,lps$
+----------------------------------------------------+
| Ordinary
least squares regression
|
| Model was estimated Dec 09, 2005 at 03:49:35PM
|
| LHS=G
Mean
=
3.309784
|
|
Standard deviation
=
.2384918
|
| WTS=none
Number of observs.
=
52
|
| Model size
Parameters
=
6
|
|
Degrees of freedom
=
46
|
| Residuals
Sum of squares
=
.6931595E-01 |
|
Standard error of e =
.3881840E-01 |
| Fit
R-squared
=
.9761045
|
|
Adjusted R-squared
=
.9735072
|
| Model test
F[ 5,
46] (prob) = 375.81 (.0000) |
| Diagnostic
Log likelihood
=
98.34362
|
|
Restricted(b=0)
=
1.257919
|
|
Chi-sq [ 5] (prob) = 194.17 (.0000) |
| Info criter. LogAmemiya Prd. Crt. = -6.388522
|
|
Akaike Info. Criter. = -6.389555
|
| Autocorrel
Durbin-Watson Stat. =
.4511786
|
|
Rho = cor[e,e(-1)]
=
.7744107
|
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-11.5868243
.86301823
-13.426
.0000
PG
-.00010939
.06072810
-.002
.9986
3.72930296
Y
1.66842867
.09644870
17.299
.0000
9.67487347
LPN
-.14775813
.25408578
-.582
.5637
4.23689080
LPD
.38989123
.10278846
3.793
.0004
4.23906603
LPS
-.54403942
.14749686
-3.688
.0006
4.17535768
--> Calc ; ss_all=sumsqdev$
--> Reje ; post73 = 0 $
--> regr;lhs=g;rhs=one,pg,y,lpn,lpd,lps$
+----------------------------------------------------+
| Ordinary
least squares regression
|
| Model was estimated Dec 09, 2005 at 03:49:36PM
|
| LHS=G
Mean
=
3.469481
|
|
Standard deviation
=
.7095988E-01 |
| WTS=none
Number of observs.
=
31
|
| Model size
Parameters
=
6
|
|
Degrees of freedom
=
25
|
| Residuals
Sum of squares
=
.5248486E-02 |
|
Standard error of e =
.1448929E-01 |
| Fit
R-squared
=
.9652554
|
|
Adjusted R-squared
=
.9583065
|
| Model test
F[ 5,
25] (prob) = 138.91 (.0000) |
| Diagnostic
Log likelihood
=
90.61185
|
|
Restricted(b=0)
=
38.53601
|
|
Chi-sq [ 5] (prob) = 104.15 (.0000) |
| Info criter. LogAmemiya Prd. Crt. = -8.291761
|
|
Akaike Info. Criter. = -8.296706
|
| Autocorrel
Durbin-Watson Stat. =
.9925038
|
|
Rho = cor[e,e(-1)]
=
.5037481
|
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-3.68022774
1.28954452
-2.854
.0086
PG
-.16037492
.03091908
-5.187
.0000
4.24130024
Y
.75407900
.13320588
5.661
.0000
9.92138226
LPN
.40440099
.19940977
2.028
.0533
4.70939062
LPD
.01238540
.06367906
.194
.8474
4.61615756
LPS
-.33722011
.15797771
-2.135
.0428
4.78397912
--> Calc ; ss_pre=sumsqdev$
--> Include;new;post73=1$
--> regr;lhs=g;rhs=one,pg,y,lpn,lpd,lps$
+----------------------------------------------------+
| Ordinary
least squares regression
|
| Model was estimated Dec 09, 2005 at 03:49:36PM
|
| LHS=G
Mean
=
3.469481
|
|
Standard deviation
=
.7095988E-01 |
| WTS=none
Number of observs.
=
31
|
| Model size
Parameters
=
6
|
|
Degrees of freedom
=
25
|
| Residuals
Sum of squares
=
.5248486E-02 |
|
Standard error of e =
.1448929E-01 |
| Fit
R-squared
=
.9652554
|
|
Adjusted R-squared
=
.9583065
|
| Model test
F[ 5,
25] (prob) = 138.91 (.0000) |
| Diagnostic
Log likelihood
=
90.61185
|
|
Restricted(b=0)
=
38.53601
|
|
Chi-sq [ 5] (prob) = 104.15 (.0000) |
| Info criter. LogAmemiya Prd. Crt. = -8.291761
|
|
Akaike Info. Criter. = -8.296706
|
| Autocorrel
Durbin-Watson Stat. =
.9925038
|
|
Rho = cor[e,e(-1)]
=
.5037481
|
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-3.68022774
1.28954452
-2.854
.0086
PG
-.16037492
.03091908
-5.187
.0000
4.24130024
Y
.75407900
.13320588
5.661
.0000
9.92138226
LPN
.40440099
.19940977
2.028
.0533
4.70939062
LPD
.01238540
.06367906
.194
.8474
4.61615756
LPS
-.33722011
.15797771
-2.135
.0428
4.78397912
--> Calc ; ss_post=sumsqdev$
--> Calc;list ;F = ((ss_all - (ss_pre + ss_post))/6) /
((ss_pre + ss_post)/(n-12)) $
F
= .17744175824374870D+02
The F statistic is quite large. The hypothesis that the parameters are unchanged should be rejected.
2. Using the model from part 1, reestimate the regression model using the 1953-2003 data (leaving out
2004). Then, use your estimated model to predict the 2004 value of GasQ (not log 100000*logGasQ/Pop).
How well did you do? Explain all your calculations, and show the computations in detail.
--> Sample ; 1 - 51 $
--> Regress; Lhs = g ; Rhs = one,pg,y,lpn,lpd,lps $
+----------------------------------------------------+
| Ordinary
least squares regression
|
| Model was estimated Dec 09, 2005 at 04:18:42PM
|
| LHS=G
Mean
=
3.304901
|
|
Standard deviation
=
.2382243
|
| WTS=none
Number of observs.
=
51
|
| Model size
Parameters
=
6
|
|
Degrees of freedom
=
45
|
| Residuals
Sum of squares
=
.6701323E-01 |
|
Standard error of e =
.3858993E-01 |
| Fit
R-squared
=
.9763833
|
|
Adjusted R-squared
=
.9737593
|
| Model test
F[ 5,
45] (prob) = 372.09 (.0000) |
| Diagnostic
Log likelihood
=
96.81875
|
|
Restricted(b=0)
=
1.300784
|
|
Chi-sq [ 5] (prob) = 191.04 (.0000) |
| Info criter. LogAmemiya Prd. Crt. = -6.398302
|
|
Akaike Info. Criter. = -6.399397
|
| Autocorrel
Durbin-Watson Stat. =
.4489208
|
|
Rho = cor[e,e(-1)]
=
.7755396
|
+----------------------------------------------------+
+---------+--------------+----------------+--------+---------+----------+
|Variable | Coefficient | Standard Error |t-ratio |P[|T|>t] | Mean of X|
+---------+--------------+----------------+--------+---------+----------+
Constant
-11.2451640
.90086087
-12.483
.0000
PG
.02074016
.06265577
.331
.7422
3.70792688
Y
1.64092503
.09839906
16.676
.0000
9.66435597
LPN
-.15241924
.25261814
-.603
.5493
4.21901304
LPD
.31345469
.11924714
2.629
.0117
4.22918122
LPS
-.49814728
.15120189
-3.295
.0019
4.15122205
--> Sample ; 52 $
--> calc;list;pop2004=293951$
POP2004 = .29395100000000000D+06
--> Namelist ; x = one,pg,y,lpn,lpd,lps $
--> matrix
; mx=x ;mx=mx'$
--> Calc
; PredLG = mx'b ;list; PredG=exp(PredLG)*pop2004/100000$
PREDG
= .10971197968321570D+03
Actual value is 103.245.
109.712 is too large by 6.26%
Related documents