Эконометрика, , 4 модуль Семинар Для Группы Э_Б2015_Э_3 Семинарист О.А.Демидова

Similar documents
Day 2A Instrumental Variables, Two-stage Least Squares and Generalized Method of Moments

4 Instrumental Variables Single endogenous variable One continuous instrument. 2

4 Instrumental Variables Single endogenous variable One continuous instrument. 2

Econometrics. 8) Instrumental variables

Fixed and Random Effects Models: Vartanian, SW 683

Problem Set 10: Panel Data

GMM Estimation in Stata

IV and IV-GMM. Christopher F Baum. EC 823: Applied Econometrics. Boston College, Spring 2014

Lecture#12. Instrumental variables regression Causal parameters III

Microeconometrics (PhD) Problem set 2: Dynamic Panel Data Solutions

Measurement Error. Often a data set will contain imperfect measures of the data we would ideally like.

Warwick Economics Summer School Topics in Microeconometrics Instrumental Variables Estimation

Maria Elena Bontempi Roberto Golinelli this version: 5 September 2007

Instrumental Variables, Simultaneous and Systems of Equations

Handout 11: Measurement Error

Simultaneous Equations with Error Components. Mike Bronner Marko Ledic Anja Breitwieser

Handout 12. Endogeneity & Simultaneous Equation Models

Practice 2SLS with Artificial Data Part 1

Question 1a 1b 1c 1d 1e 2a 2b 2c 2d 2e 2f 3a 3b 3c 3d 3e 3f M ult: choice Points

Day 3B Nonparametrics and Bootstrap

1: a b c d e 2: a b c d e 3: a b c d e 4: a b c d e 5: a b c d e. 6: a b c d e 7: a b c d e 8: a b c d e 9: a b c d e 10: a b c d e

An explanation of Two Stage Least Squares

Ecmt 675: Econometrics I

1

Generalized method of moments estimation in Stata 11

Dealing With and Understanding Endogeneity

Dynamic Panels. Chapter Introduction Autoregressive Model

Please discuss each of the 3 problems on a separate sheet of paper, not just on a separate page!

point estimates, standard errors, testing, and inference for nonlinear combinations

ECON Introductory Econometrics. Lecture 16: Instrumental variables

ECON Introductory Econometrics. Lecture 5: OLS with One Regressor: Hypothesis Tests

ESTIMATING AVERAGE TREATMENT EFFECTS: REGRESSION DISCONTINUITY DESIGNS Jeff Wooldridge Michigan State University BGSE/IZA Course in Microeconometrics

Lecture 8: Instrumental Variables Estimation

Dynamic Panel Data Models

Econometrics II. Lecture 4: Instrumental Variables Part I

Final Exam. Question 1 (20 points) 2 (25 points) 3 (30 points) 4 (25 points) 5 (10 points) 6 (40 points) Total (150 points) Bonus question (10)

Lecture 4: Multivariate Regression, Part 2

Problem Set 1 ANSWERS

Section Least Squares Regression

Control Function and Related Methods: Nonlinear Models

xtdpdqml: Quasi-maximum likelihood estimation of linear dynamic short-t panel data models

Day 1B Count Data Regression: Part 2

Econometrics. 9) Heteroscedasticity and autocorrelation

Problem Set #3-Key. wage Coef. Std. Err. t P> t [95% Conf. Interval]

. *DEFINITIONS OF ARTIFICIAL DATA SET. mat m=(12,20,0) /*matrix of means of RHS vars: edu, exp, error*/

Answer all questions from part I. Answer two question from part II.a, and one question from part II.b.

Marginal Effects for Continuous Variables Richard Williams, University of Notre Dame, Last revised January 20, 2018

Suggested Answers Problem set 4 ECON 60303

Quantitative Methods Final Exam (2017/1)

Day 1A Ordinary Least Squares and GLS

General Linear Model (Chapter 4)

Final Exam. 1. Definitions: Briefly Define each of the following terms as they relate to the material covered in class.

Nonrecursive Models Highlights Richard Williams, University of Notre Dame, Last revised April 6, 2015

Autocorrelation. Think of autocorrelation as signifying a systematic relationship between the residuals measured at different points in time

Econometrics Midterm Examination Answers

Instrumental Variables and GMM: Estimation and Testing. Steven Stillman, New Zealand Department of Labour

8. Nonstandard standard error issues 8.1. The bias of robust standard errors

Binary Dependent Variables

Fortin Econ Econometric Review 1. 1 Panel Data Methods Fixed Effects Dummy Variables Regression... 7

****Lab 4, Feb 4: EDA and OLS and WLS

Lecture 5. In the last lecture, we covered. This lecture introduces you to

ECON2228 Notes 7. Christopher F Baum. Boston College Economics. cfb (BC Econ) ECON2228 Notes / 41

ECON2228 Notes 10. Christopher F Baum. Boston College Economics. cfb (BC Econ) ECON2228 Notes / 48

Exercices for Applied Econometrics A

Day 4A Nonparametrics

Mediation Analysis: OLS vs. SUR vs. 3SLS Note by Hubert Gatignon July 7, 2013, updated November 15, 2013

Economics 326 Methods of Empirical Research in Economics. Lecture 14: Hypothesis testing in the multiple regression model, Part 2

Exam ECON3150/4150: Introductory Econometrics. 18 May 2016; 09:00h-12.00h.

sociology 362 regression

Introductory Econometrics. Lecture 13: Hypothesis testing in the multiple regression model, Part 1

2.1. Consider the following production function, known in the literature as the transcendental production function (TPF).

Testing methodology. It often the case that we try to determine the form of the model on the basis of data

ECON2228 Notes 10. Christopher F Baum. Boston College Economics. cfb (BC Econ) ECON2228 Notes / 54

Case of single exogenous (iv) variable (with single or multiple mediators) iv à med à dv. = β 0. iv i. med i + α 1

Specification Error: Omitted and Extraneous Variables

Lab 07 Introduction to Econometrics

Problem Set 5 ANSWERS

Lecture 3 Linear random intercept models

Empirical Asset Pricing

STATISTICS 110/201 PRACTICE FINAL EXAM

Essential of Simple regression

ECON Introductory Econometrics. Lecture 6: OLS with Multiple Regressors

Autoregressive models with distributed lags (ADL)

Extended regression models using Stata 15

(a) Briefly discuss the advantage of using panel data in this situation rather than pure crosssections

Applied Econometrics. Lecture 3: Introduction to Linear Panel Data Models

Heteroskedasticity Example

Instrumental Variables Estimation in Stata

1: a b c d e 2: a b c d e 3: a b c d e 4: a b c d e 5: a b c d e. 6: a b c d e 7: a b c d e 8: a b c d e 9: a b c d e 10: a b c d e

ECON3150/4150 Spring 2016

Problem Set #5-Key Sonoma State University Dr. Cuellar Economics 317- Introduction to Econometrics

Longitudinal Data Analysis Using Stata Paul D. Allison, Ph.D. Upcoming Seminar: May 18-19, 2017, Chicago, Illinois

sociology 362 regression

Lecture 4: Multivariate Regression, Part 2

Lab 11 - Heteroskedasticity

Section I. Define or explain the following terms (3 points each) 1. centered vs. uncentered 2 R - 2. Frisch theorem -

Graduate Econometrics Lecture 4: Heteroskedasticity

Implementing Conditional Tests with Correct Size in the Simultaneous Equations Model

Interpreting coefficients for transformed variables

ECON Introductory Econometrics. Lecture 7: OLS with Multiple Regressors Hypotheses tests

Transcription:

Эконометрика, 2017-2018, 4 модуль Семинар 3 160418 Для Группы Э_Б2015_Э_3 Семинарист ОАДемидова * Stata program * copyright C 2010 by A Colin Cameron and Pravin K Trivedi * used for "Microeconometrics Using Stata, Revised Edition" * by A Colin Cameron and Pravin K Trivedi (2010) * Stata Press * Chapter 6 * 63: INSTRUMENTAL VARIABLES EXAMPLE * 64: WEAK INSTRUMENTS ********** DATA DESCRIPTION ********** * The original data is from MEPS over 65 similar to chapter 3 1

global x2list totchr age female blhisp linc summarize ldrugexp hi_empunion $x2list Variable Obs Mean Std Dev Min Max ldrugexp 10391 6479668 1363395 0 1018017 hi_empunion 10391 3796555 4853245 0 1 totchr 10391 1860745 1290131 0 9 age 10391 7504639 669368 65 91 female 10391 5797325 4936256 0 1 blhisp 10391 1703397 3759491 0 1 linc 10089 2743275 9131433-6907755 5744476 2

* Summarize available instruments summarize ssiratio lowincome multlc firmsz if linc!= Variable Obs Mean Std Dev Min Max ssiratio 10089 5365438 3678175 0 925062 lowincome 10089 1874319 3902771 0 1 multlc 10089 0620478 2412543 0 1 firmsz 10089 1405293 2170389 0 50 3

* IV estimation of a just-identified model with single endog regressor ivregress 2sls ldrugexp (hi_empunion = ssiratio) $x2list, vce(robust) first First-stage regressions Number of obs = 10089 F( 6, 10082) = 11918 Prob > F = 00000 R-squared = 00761 Adj R-squared = 00755 Root MSE = 04672 Robust hi_empunion Coef Std Err t P> t [95% Conf Interval] totchr 0127865 0036655 349 0000 0056015 0199716 age -0086323 0007087-1218 0000-0100216 -0072431 female -07345 0096392-762 0000-0923448 -0545552 blhisp -06268 0122742-511 0000-08674 -0386201 linc 0483937 0066075 732 0000 0354417 0613456 ssiratio -1916432 0236326-811 0000-2379678 -1453186 _cons 1028981 0581387 1770 0000 9150172 1142944 Instrumental variables (2SLS) regression Number of obs = 10089 Wald chi2(6) = 200086 Prob > chi2 = 00000 R-squared = 00640 Root MSE = 13177 Robust ldrugexp Coef Std Err z P> z [95% Conf Interval] hi_empunion -8975913 2211268-406 0000-1330992 -4641908 totchr 4502655 0101969 4416 0000 43028 470251 age -0132176 0029977-441 0000-0190931 -0073421 female -020406 0326114-063 0531-0843232 0435113 blhisp -2174244 0394944-551 0000-294832 -1400167 linc 0870018 0226356 384 0000 0426368 1313668 _cons 678717 2688453 2525 0000 6260243 7314097 Instrumented: hi_empunion Instruments: totchr age female blhisp linc ssiratio * Compare 5 estimators and variance estimates for overidentified models global ivmodel "ldrugexp (hi_empunion = ssiratio multlc) $x2list" quietly ivregress 2sls $ivmodel, vce(robust) estimates store TwoSLS quietly ivregress gmm $ivmodel, wmatrix(robust) estimates store GMM_het quietly ivregress gmm $ivmodel, wmatrix(robust) igmm estimates store GMM_igmm quietly ivregress gmm $ivmodel, wmatrix(cluster age) estimates store GMM_clu quietly ivregress 2sls $ivmodel estimates store TwoSLS_def estimates table TwoSLS GMM_het GMM_igmm GMM_clu TwoSLS_def, b(%95f) se 4

* Compare 5 estimators and variance estimates for overidentified models global ivmodel "ldrugexp (hi_empunion = ssiratio multlc) $x2list" quietly ivregress 2sls $ivmodel, vce(robust) estimates store TwoSLS quietly ivregress gmm $ivmodel, wmatrix(robust) estimates store GMM_het quietly ivregress gmm $ivmodel, wmatrix(robust) igmm estimates store GMM_igmm quietly ivregress gmm $ivmodel, wmatrix(cluster age) estimates store GMM_clu quietly ivregress 2sls $ivmodel estimates store TwoSLS_def estimates table TwoSLS GMM_het GMM_igmm GMM_clu TwoSLS_def, b(%95f) se Variable TwoSLS GMM_het GMM_igmm GMM_clu TwoSLS_~f hi_empunion -098993-099328 -099329-103587 -098993 020459 020467 020467 020438 019221 totchr 045121 045095 045095 044822 045121 001031 001031 001031 001325 001051 age -001414-001415 -001415-001185 -001414 000290 000290 000290 000626 000278 female -002784-002817 -002817-002451 -002784 003217 003219 003219 002919 003117 blhisp -022371-022310 -022311-020907 -022371 003958 003960 003960 005018 003870 linc 009427 009446 009446 009573 009427 002188 002190 002190 001474 002123 _cons 687519 687782 687783 672769 687519 025789 025800 025800 050588 024528 * Obtain OLS estimates to compare with preceding IV estimates regress ldrugexp hi_empunion $x2list, vce(robust) 5

* Obtain OLS estimates to compare with preceding IV estimates regress ldrugexp hi_empunion $x2list, vce(robust) Linear regression Number of obs = 10089 F( 6, 10082) = 37685 Prob > F = 00000 R-squared = 01770 Root MSE = 1236 Robust ldrugexp Coef Std Err t P> t [95% Conf Interval] hi_empunion 0738788 0259848 284 0004 0229435 1248141 totchr 4403807 0093633 4703 0000 4220268 4587346 age -0035295 001937-182 0068-0073264 0002675 female 0578055 0253651 228 0023 0080848 1075262 blhisp -1513068 0341264-443 0000-2182013 -0844122 linc 0104815 0137126 076 0445-0163979 037361 _cons 5861131 1571037 3731 0000 5553176 6169085 * Robust Durbin-Wu-Hausman test of endogeneity implemented by estat endogenous ivregress 2sls ldrugexp (hi_empunion = ssiratio) $x2list, vce(robust) estat endogenous * Robust Durbin-Wu-Hausman test of endogeneity implemented by estat endogenous ivregress 2sls ldrugexp (hi_empunion = ssiratio) $x2list, vce(robust) Instrumental variables (2SLS) regression Number of obs = 10089 Wald chi2(6) = 200086 Prob > chi2 = 00000 R-squared = 00640 Root MSE = 13177 Robust ldrugexp Coef Std Err z P> z [95% Conf Interval] hi_empunion -8975913 2211268-406 0000-1330992 -4641908 totchr 4502655 0101969 4416 0000 43028 470251 age -0132176 0029977-441 0000-0190931 -0073421 female -020406 0326114-063 0531-0843232 0435113 blhisp -2174244 0394944-551 0000-294832 -1400167 linc 0870018 0226356 384 0000 0426368 1313668 _cons 678717 2688453 2525 0000 6260243 7314097 Instrumented: hi_empunion Instruments: totchr age female blhisp linc ssiratio estat endogenous Tests of endogeneity Ho: variables are exogenous Robust score chi2(1) = 24935 (p = 00000) Robust regression F(1,10081) = 264333 (p = 00000) * Robust Durbin-Wu-Hausman test of endogeneity implemented manually quietly regress hi_empunion ssiratio $x2list quietly predict v1hat, resid quietly regress ldrugexp hi_empunion v1hat $x2list, vce(robust) test v1hat 6

* Robust Durbin-Wu-Hausman test of endogeneity implemented manually quietly regress hi_empunion ssiratio $x2list quietly predict v1hat, resid quietly regress ldrugexp hi_empunion v1hat $x2list, vce(robust) test v1hat ( 1) v1hat = 0 F( 1, 10081) = 2643 Prob > F = 00000 * Test of overidentifying restrictions following ivregress gmm quietly ivregress gmm ldrugexp (hi_empunion = ssiratio multlc) $x2list, wmatrix(robust) estat overid quietly ivregress gmm ldrugexp (hi_empunion = ssiratio multlc) $x2list, wmatrix(robust) estat overid Test of overidentifying restriction: Hansen's J chi2(1) = 104754 (p = 03061) * Test of overidentifying restrictions following ivregress gmm ivregress gmm ldrugexp (hi_empunion = ssiratio lowincome multlc firmsz) $x2list, wmatrix(robust) estat overid ivregress gmm ldrugexp (hi_empunion = ssiratio lowincome multlc firmsz) $x2list, wmatrix(robust) Instrumental variables (GMM) regression Number of obs = 10089 Wald chi2(6) = 204212 Prob > chi2 = 00000 R-squared = 00829 GMM weight matrix: Robust Root MSE = 13043 Robust ldrugexp Coef Std Err z P> z [95% Conf Interval] hi_empunion -8124043 1846433-440 0000-1174299 -45051 totchr 449488 010047 4474 0000 4297962 4691799 age -0124598 0027466-454 0000-0178432 -0070765 female -0104528 0306889-034 0733-0706019 0496963 blhisp -2061018 0382891-538 0000-2811471 -1310566 linc 0796532 0203397 392 0000 0397882 1195183 _cons 67126 2425973 2767 0000 6237118 7188081 Instrumented: hi_empunion Instruments: totchr age female blhisp linc ssiratio lowincome multlc firmsz estat overid Test of overidentifying restriction: Hansen's J chi2(3) = 115903 (p = 00089) ********** 64: WEAK INSTRUMENTS * Correlations of endogenous regressor with instruments correlate hi_empunion ssiratio lowincome multlc firmsz if linc!= 7

correlate hi_empunion ssiratio lowincome multlc firmsz if linc!= (obs=10089) hi_emp~n ssiratio lowinc~e multlc firmsz hi_empunion 10000 ssiratio -02124 10000 lowincome -01164 02539 10000 multlc 01198-01904 -00625 10000 firmsz 00374-00446 -00082 01873 10000 * Weak instrument tests - just-identified model quietly ivregress 2sls ldrugexp (hi_empunion = ssiratio) $x2list, vce(robust) estat firststage, forcenonrobust all * Weak instrument tests - just-identified model quietly ivregress 2sls ldrugexp (hi_empunion = ssiratio) $x2list, vce(robust) estat firststage, forcenonrobust all First-stage regression summary statistics Adjusted Partial Robust Variable R-sq R-sq R-sq F(1,10082) Prob > F hi_empunion 00761 00755 00179 657602 00000 Shea's partial R-squared Variable Shea's Shea's Partial R-sq Adj Partial R-sq hi_empunion 00179 00174 Minimum eigenvalue statistic = 18398 Critical Values # of endogenous regressors: 1 Ho: Instruments are weak # of excluded instruments: 1 2SLS relative bias 5% 10% 20% 30% (not available) 10% 15% 20% 25% 2SLS Size of nominal 5% Wald test 1638 896 666 553 LIML Size of nominal 5% Wald test 1638 896 666 553 * Weak instrument tests - two or more overidentifying restrictions quietly ivregress gmm ldrugexp (hi_empunion = ssiratio lowincome multlc firmsz) $x2list, vce(robust) estat firststage, forcenonrobust 8

* Weak instrument tests - two or more overidentifying restrictions quietly ivregress gmm ldrugexp (hi_empunion = ssiratio lowincome multlc firmsz) $x2list, vce(robust) estat firststage, forcenonrobust First-stage regression summary statistics Adjusted Partial Robust Variable R-sq R-sq R-sq F(4,10079) Prob > F hi_empunion 00821 00812 00243 44823 00000 Minimum eigenvalue statistic = 62749 Critical Values # of endogenous regressors: 1 Ho: Instruments are weak # of excluded instruments: 4 5% 10% 20% 30% 2SLS relative bias 1685 1027 671 534 10% 15% 20% 25% 2SLS Size of nominal 5% Wald test 2458 1396 1026 831 LIML Size of nominal 5% Wald test 544 387 330 298 * Compare 4 just-identified model estimates with different instruments quietly regress ldrugexp hi_empunion $x2list, vce(robust) estimates store OLS0 quietly ivregress 2sls ldrugexp (hi_empunion=ssiratio) $x2list, vce(robust) estimates store IV_INST1 quietly estat firststage, forcenonrobust scalar me1 = r(mineig) quietly ivregress 2sls ldrugexp (hi_empunion=lowincome) $x2list, vce(robust) estimates store IV_INST2 quietly estat firststage, forcenonrobust scalar me2 = r(mineig) quietly ivregress 2sls ldrugexp (hi_empunion=multlc) $x2list, vce(robust) estimates store IV_INST3 quietly estat firststage, forcenonrobust scalar me3 = r(mineig) quietly ivregress 2sls ldrugexp (hi_empunion=firmsz) $x2list, vce(robust) estimates store IV_INST4 quietly estat firststage, forcenonrobust scalar me4 = r(mineig) estimates table OLS0 IV_INST1 IV_INST2 IV_INST3 IV_INST4, b(%84f) se display "Minimum eigenvalues are: " me1 _s(2) me2 _s(2) me3 _s(2) me4 9

* Compare 4 just-identified model estimates with different instruments quietly regress ldrugexp hi_empunion $x2list, vce(robust) estimates store OLS0 quietly ivregress 2sls ldrugexp (hi_empunion=ssiratio) $x2list, vce(robust) estimates store IV_INST1 quietly estat firststage, forcenonrobust scalar me1 = r(mineig) quietly ivregress 2sls ldrugexp (hi_empunion=lowincome) $x2list, vce(robust) estimates store IV_INST2 quietly estat firststage, forcenonrobust scalar me2 = r(mineig) quietly ivregress 2sls ldrugexp (hi_empunion=multlc) $x2list, vce(robust) estimates store IV_INST3 quietly estat firststage, forcenonrobust scalar me3 = r(mineig) quietly ivregress 2sls ldrugexp (hi_empunion=firmsz) $x2list, vce(robust) estimates store IV_INST4 quietly estat firststage, forcenonrobust scalar me4 = r(mineig) estimates table OLS0 IV_INST1 IV_INST2 IV_INST3 IV_INST4, b(%84f) se Variable OLS0 IV_INST1 IV_INST2 IV_INST3 IV_INST4 hi_empunion 00739-08976 01170-13459 -29323 00260 02211 03594 04238 14025 totchr 04404 04503 04399 04548 04710 00094 00102 00100 00116 00203 age -00035-00132 -00031-00177 -00335 00019 00030 00041 00048 00143 female 00578-00204 00613-00565 -01842 00254 00326 00381 00449 01203 blhisp -01513-02174 -01484-02479 -03559 00341 00395 00416 00489 01098 linc 00105 00870 00071 01223 02473 00137 00226 00311 00371 01130 _cons 58611 67872 58201 72145 87267 01571 02688 03812 04419 13594 legend: b/se display "Minimum eigenvalues are: " me1 _s(2) me2 _s(2) me3 _s(2) me4 Minimum eigenvalues are: 18397973 54328603 55157581 99595082 10

Hausman test ivreg ldrugexp (hi_empunion = ssiratio) $x2list Instrumental variables (2SLS) regression Source SS df MS Number of obs = 10089 F( 6, 10082) = 31962 Model 119689964 6 199483274 Prob > F = 00000 Residual 175182166 10082 173757355 R-squared = 00640 Adj R-squared = 00634 Total 187151162 10088 185518599 Root MSE = 13182 ldrugexp Coef Std Err t P> t [95% Conf Interval] hi_empunion -8975913 2079906-432 0000-1305294 -4898882 totchr 4502655 0104225 4320 0000 4298354 4706957 age -0132176 0028759-460 0000-0188549 -0075802 female -020406 0315518-065 0518-0822538 0414418 blhisp -2174244 0386879-562 0000-2932603 -1415884 linc 0870018 0220221 395 0000 0438342 1301694 _cons 678717 2555229 2656 0000 6286294 7288046 Instrumented: hi_empunion Instruments: totchr age female blhisp linc ssiratio est store IV regress ldrugexp hi_empunion $x2list Source SS df MS Number of obs = 10089 F( 6, 10082) = 36132 Model 331206802 6 552011337 Prob > F = 00000 Residual 154030482 10082 152777705 R-squared = 01770 Adj R-squared = 01765 Total 187151162 10088 185518599 Root MSE = 1236 ldrugexp Coef Std Err t P> t [95% Conf Interval] hi_empunion 0738788 0261088 283 0005 0227003 1250573 totchr 4403807 0095731 4600 0000 4216155 459146 age -0035295 001886-187 0061-0072265 0001675 female 0578055 0251633 230 0022 0084803 1071307 blhisp -1513068 0338083-448 0000-2175778 -0850358 linc 0104815 0139518 075 0453-0168667 0378298 _cons 5861131 1531845 3826 0000 5560858 6161403 est store OLS hausman IV OLS Coefficients (b) (B) (b-b) sqrt(diag(v_b-v_b)) IV OLS Difference SE hi_empunion -8975913 0738788-9714701 2063454 totchr 4502655 4403807 0098848 0041211 age -0132176-0035295 -0096881 0021711 female -020406 0578055-0782115 0190347 blhisp -2174244-1513068 -0661176 0188083 linc 0870018 0104815 0765202 0170388 b = consistent under Ho and Ha; obtained from ivreg B = inconsistent under Ha, efficient under Ho; obtained from regress Test: Ho: difference in coefficients not systematic chi2(6) = (b-b)'[(v_b-v_b)^(-1)](b-b) = 2217 Prob>chi2 = 00011 11