GMM Estimation in Stata

Similar documents
Generalized method of moments estimation in Stata 11

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

Econometrics. 8) Instrumental variables

Lecture#12. Instrumental variables regression Causal parameters III

Dealing With and Understanding Endogeneity

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

ECON 594: Lecture #6

Some Stata commands for endogeneity in nonlinear panel-data models

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

Warwick Economics Summer School Topics in Microeconometrics Instrumental Variables Estimation

4 Instrumental Variables Single endogenous variable One continuous instrument. 2

Dynamic Panels. Chapter Introduction Autoregressive Model

4 Instrumental Variables Single endogenous variable One continuous instrument. 2

Generalised method of moments estimation of structural mean models

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

Dynamic Panel Data Models

A Journey to Latent Class Analysis (LCA)

Generalised method of moments estimation of structural mean models

Dynamic Panel Data estimators

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

Instrumental Variables, Simultaneous and Systems of Equations

ECON Introductory Econometrics. Lecture 16: Instrumental variables

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

Empirical Asset Pricing

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

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

Ecmt 675: Econometrics I

Binary Dependent Variables

Lab 11 - Heteroskedasticity

Treatment interactions with nonexperimental data in Stata

Implementing weak-instrument robust tests for a general class of instrumental-variables models

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

An explanation of Two Stage Least Squares

Jeffrey M. Wooldridge Michigan State University

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

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

Extended regression models using Stata 15

Econometrics Homework 4 Solutions

Econometrics. 9) Heteroscedasticity and autocorrelation

Day 3B Nonparametrics and Bootstrap

Implementing Conditional Tests with Correct Size in the Simultaneous Equations Model

Stata tip 63: Modeling proportions

Estimating the Fractional Response Model with an Endogenous Count Variable

Econ 836 Final Exam. 2 w N 2 u N 2. 2 v N

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

Lecture 8: Instrumental Variables Estimation

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

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

CRE METHODS FOR UNBALANCED PANELS Correlated Random Effects Panel Data Models IZA Summer School in Labor Economics May 13-19, 2013 Jeffrey M.

Homework Solutions Applied Logistic Regression

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

Practice 2SLS with Artificial Data Part 1

Control Function and Related Methods: Nonlinear Models

Applied Statistics and Econometrics

Multivariate probit regression using simulated maximum likelihood

Handout 12. Endogeneity & Simultaneous Equation Models

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

Appendix A. Numeric example of Dimick Staiger Estimator and comparison between Dimick-Staiger Estimator and Hierarchical Poisson Estimator

Lab 6 - Simple Regression

11. Bootstrap Methods

Partial effects in fixed effects models

Greene, Econometric Analysis (7th ed, 2012)

-redprob- A Stata program for the Heckman estimator of the random effects dynamic probit model

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

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

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

Econometrics Midterm Examination Answers

dqd: A command for treatment effect estimation under alternative assumptions

Instrumental variables estimation using heteroskedasticity-based instruments

Day 1A Ordinary Least Squares and GLS

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

Generalized linear models

Spatial Regression Models: Identification strategy using STATA TATIANE MENEZES PIMES/UFPE

Section Least Squares Regression

Problem set - Selection and Diff-in-Diff

Model and Working Correlation Structure Selection in GEE Analyses of Longitudinal Data

Heteroskedasticity Example

Lab 07 Introduction to Econometrics

Exercices for Applied Econometrics A

7/28/15. Review Homework. Overview. Lecture 6: Logistic Regression Analysis

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

Using generalized structural equation models to fit customized models without programming, and taking advantage of new features of -margins-

Motivation Non-linear Rational Expectations The Permanent Income Hypothesis The Log of Gravity Non-linear IV Estimation Summary.

Introduction to Econometrics

Problem Set 10: Panel Data

David M. Drukker Italian Stata Users Group meeting 15 November Executive Director of Econometrics Stata

Econometrics II. Lecture 4: Instrumental Variables Part I

Day 1B Count Data Regression: Part 2

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

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

Econometrics I. Ricardo Mora

GMM and Maximum Likelihood estimators with Mata and moptimize

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

Statistical Modelling in Stata 5: Linear Models

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

xtseqreg: Sequential (two-stage) estimation of linear panel data models

Handout 11: Measurement Error

Quantitative Methods Final Exam (2017/1)

Nonlinear Regression Functions

use conditional maximum-likelihood estimator; the default constraints(constraints) apply specified linear constraints

Transcription:

GMM Estimation in Stata Econometrics I Department of Economics Universidad Carlos III de Madrid Master in Industrial Economics and Markets 1

Outline Motivation 1 Motivation 2 3 4 2

Motivation 3

Stata and GMM Stata can compute the GMM estimators for some linear models: 1 regression with exogenous instruments using ivregress (ivreg, ivreg2 for Stata 9) demand function using 2SLS ivreg 2sls q demand_shiftrs (p =supply_shiftrs ), vce(robust) demand function using GMM ivreg gmm q demand_shiftrs (p =supply_shiftrs ) with heteroskedasticity, the GMM estimator will be more e cient than the 2SLS estimator 2 xtabond for dynamic panel data since Stata 11, it is possible to obtain GMM estimates of non-linear models using the gmm command 4

5

the command gmm estimates parameters by GMM you can specify the moment conditions as substitutable expressions a substitutable expression in Stata is like any mathematical expression, except that the parameters of the model are enclosed in braces {} alternatively, you may use command program to create a program that you can use as an argument we are going to focus on examples using substitutable expressions 6

The syntax of gmm with instruments If E [ze(b)] = 0 where z is a q 1 vector of instrumental variables and e(b) is a scalar function of the data and the parameters beta gmm (e (b)), instruments(z_list) options by default, it computes the two-step estimator with identity matrix in the rst step use onestep option to get the one-step estimator and igmm to get the iterative estimator use vce(robust) to get sandwich standard errors use winitial(wmtype) and wmatrix(witype) to change weight-matrix computations gmm admits if, in, and weight quali ers 7

More general moment conditions (1) in some applications we cannot write the moment conditions as the product of a residual and a list of instruments suppose you have two general moment conditions E [h 1 (b)] = 0 E [h 2 (b)] = 0 gmm (h 1 (b)) (h 2 (b)), igmm computes the iterative GMM estimator imposing in the sample the two moment conditions 8

More general moment conditions (2) instruments may vary with error terms E [z 1 e 1 (b)] = 0 E [z 2 e 2 (b)] = 0 gmm (e 1 (b)) (e 2 (b)), instruments(1:z 1 ) instruments(2:z 2 ) nolog this computes the twostep GMM estimator without adding information on the rst step you can use this syntax to estimate supply and demand functions simultaneously 9

10

Linear regresssion Motivation Assume that so that E [v x 1, x 2] = 0 Then The gmm command: depvar = β 0 + β 1 x 1 + β 2 x 2 + v E [(depvar (β 0 + β 1 x 1 + β 2 x 2))] = 0 E [x 1(depvar (β 0 + β 1 x 1 + β 2 x 2))] = 0 E [x 2(depvar (β 0 + β 1 x 1 + β 2 x 2))] = 0 gmm (depvar-x1*{b1}-x2*{b2}-{b3}), instruments(x1 x2) nolog equivalently (names of the variables will be displayed in the output) and simpler to write: gmm (depvar-{xb:x1 x2}-{b0}), instruments(x1 x2) nolog 11

Estimating OLS with gmm command. regress mpg gear_ratio turn, r Linear regression Number of obs = 74 F( 2, 71) = 47.92 Prob > F = 0.0000 R-squared = 0.5483 Root MSE = 3.9429 Robust mpg Coef. Std. Err. t P> t [95% Conf. Interval] -------------+---------------------------------------------------------------- gear_ratio 3.032884 1.533061 1.98 0.052 -.023954 6.089721 turn -.7330502.1204386-6.09 0.000 -.9731979 -.4929025 _cons 41.21801 8.5723 4.81 0.000 24.12533 58.31069 gmm (mpg - {b1}*gear_ratio - {b2}*turn - {b0}), instruments(gear_ratio turn) nolog Final G M M criterion Q(b) = 3.48e-32 G M M estimation Number of parameters = 3 Number of moments = 3 Initial weight matrix: Unadjusted Number of obs = 74 G M M weight matrix: Robust Robust Coef. Std. Err. z P> z [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1 3.032884 1.501664 2.02 0.043.0896757 5.976092 /b2 -.7330502.117972-6.21 0.000 -.9642711 -.5018293 /b0 41.21801 8.396739 4.91 0.000 24.76071 57.67532 Instruments for equation 1: gear_ratio turn _cons 12

2SLS and gmm Motivation gmm (depvar-{xb:x1 x2}-{b0}), instruments(z1 z2 z3) onestep ivregress 2sls mpg gear_ratio (turn = weight length headroom) Instrumental variables (2SLS) regression Number of obs = 74 Wald chi2(2) = 90.94 Prob > chi2 = 0.0000 R-squared = 0.4656 Root MSE = 4.2007 mpg Coef. Std. Err. z P> z [95% Conf. Interval] -------------+---------------------------------------------------------------- turn -1.246426.2012157-6.19 0.000-1.640801 -.8520502 gear_ratio -.3146499 1.697806-0.19 0.853-3.642288 3.012988 _cons 71.66502 12.3775 5.79 0.000 47.40556 95.92447 Instrumented: turn Instruments: gear_ratio weight length headroom. gmm (mpg - {b1}*turn - {b2}*gear_ratio - {b0}), instruments(gear_ratio weight length headroom) onestep Step 1 Iteration 0: G M M criterion Q(b) = 475.42283 Iteration 1: G M M criterion Q(b) =.16100633 Iteration 2: G M M criterion Q(b) =.16100633 G M M estimation Number of parameters = 3 Number of moments = 5 Initial weight matrix: Unadjusted Number of obs = 74 Robust Coef. Std. Err. z P> z [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1-1.246426.1970566-6.33 0.000-1.632649 -.8602019 /b2 -.3146499 1.863079-0.17 0.866-3.966217 3.336917 /b0 71.66502 12.68722 5.65 0.000 46.79853 96.53151 Instruments for equation 1: gear_ratio weight length headroom _cons 13

Linear GMM and gmm gmm (depvar-{xb:x1 x2}-{b0}), instruments(z1 z2 z3) wmatrix(robust). ivregress gmm mpg gear_ratio (turn = weight length headroom) Instrumental variables (GMM) regression Number of obs = 74 Wald chi2(2) = 97.83 Prob > chi2 = 0.0000 R-squared = 0.4769 GMM weight matrix: Robust Root MSE = 4.1559 Robust mpg Coef. Std. Err. z P> z [95% Conf. Interval] -------------+---------------------------------------------------------------- turn -1.208549.1882903-6.42 0.000-1.577591 -.8395071 gear_ratio.130328 1.75499 0.07 0.941-3.30939 3.570046 _cons 68.89218 12.05955 5.71 0.000 45.25589 92.52847 Instrumented: turn Instruments: gear_ratio weight length headroom. gmm (mpg - {b1}*turn - {b2}*gear_ratio - {b0}), instruments(gear_ratio weight length headroom) wmatrix(robust) nolog Final G M M criterion Q(b) =.0074119 G M M estimation Number of parameters = 3 Number of moments = 5 Initial weight matrix: Unadjusted Number of obs = 74 G M M weight matrix: Robust Robust Coef. Std. Err. z P> z [95% Conf. Interval] -------------+---------------------------------------------------------------- /b1-1.208549.1882903-6.42 0.000-1.577591 -.8395071 /b2.130328 1.75499 0.07 0.941-3.30939 3.570046 /b0 68.89218 12.05955 5.71 0.000 45.25589 92.52847 Instruments for equation 1: gear_ratio weight length headroom _cons 14

15

Exponential regression with exogenous regressors exponential regression models are frequently encountered in applied work they can be used as alternatives to linear regression models on log-transformed dependent variables when the dependent variable represents a discrete count variable, they are also known as Poisson regression models E [y x ] = exp(x β + β 0 ) Moment conditions: E [x (y exp (x β + β 0 ))] = 0 this is equivalent to E [x (y exp (x β ) + γ)] = 0 gmm (depvar-exp({xb:x1 x2})+{b0}), instruments(x1 x2) wmatrix(robust) 16

IV Poisson regression and others suppose now E [z (y exp (x β ) + γ)] = 0 gmm (depvar-exp({xb:x1 x2})+{b0}), instruments(z1 z2 z3) wmatrix(robust) the structure of the moment conditions for some models is too complicated for the syntax used thus far you should in these cases use the moment-evaluator program syntax (see help gmm) 17

Stata can compute the GMM estimators for some linear models: 1 regression with exogenous instruments using ivregress (ivreg, ivreg2 for Stata 9) 2 xtabond for dynamic panel data since Stata 11, it is possible to obtain GMM estimates of non-linear models using the gmm command 18

MIT OpenCourseWare https://ocw.mit.edu 14.382 Econometrics Spring 2017 For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms. 19