GMM Estimation In Stata - MIT OpenCourseWare

2y ago
38 Views
3 Downloads
731.97 KB
19 Pages
Last View : 5d ago
Last Download : 3m ago
Upload by : Kaleb Stephen
Transcription

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryGMM Estimation in StataEconometrics IRicardo MoraDepartment of EconomicsUniversidad Carlos III de MadridMaster in Industrial Economics and Markets1Ricardo MoraGMM estimation

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryOutline1Motivation2Using the gmm command3Several linear examples4Nonlinear GMM2Ricardo MoraGMM estimation

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryMotivation3Ricardo MoraGMM estimation

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryStata and GMMStata can compute the GMM estimators for some linearmodels:1regression with exogenous instruments using(ivreg,ivreg2forStata 9)ivregressdemand function using 2SLSivreg 2sls q demand shiftrs (p supply shiftrs ), vce(robust)demand function usingGMMivreg gmm q demand shiftrs (p supply shiftrs )with heteroskedasticity, the GMM estimator will be moree cient than the 2SLS estimator2xtabondfor dynamic panel datasince Stata 11, it is possible to obtain GMM estimates ofnon-linear models using the gmm commandRicardo MoraGMM estimation4

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryUsing the gmm command5Ricardo MoraGMM estimation

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryUsing the gmm commandthe command gmm estimates parameters by GMMyou can specify the moment conditions as substitutableexpressionsa substitutable expression in Stata is like any mathematicalexpression, except that the parameters of the model areenclosed in braces {}alternatively, you may use command program to create aprogram that you can use as an argumentwe are going to focus on examples using substitutableexpressions6Ricardo MoraGMM estimation

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryThe syntax of gmm with instrumentsIf E [ze (b)] 0 where z is a q 1 vector of instrumentalvariables and e (b) is a scalar function of the data and theparameters betagmm (e (b)) , instruments(z list) optionsby default, it computes the two-step estimator with identitymatrix in the rst stepuse onestep option to get the one-step estimator and igmm toget the iterative estimatoruse vce(robust) to get sandwich standard errorsuse winitial(wmtype) and wmatrix(witype) to changeweight-matrix computations7gmm admits if, in, and weight quali ersRicardo MoraGMM estimation

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryMore general moment conditions (1)in some applications we cannot write the moment conditionsas the product of a residual and a list of instrumentssuppose you have two general moment conditionsE [h1 (b)] 0E [h2 (b)] 0gmm (h1 (b)) (h2 (b)), igmmcomputes the iterative GMM estimator imposing in the samplethe two moment conditionsRicardo MoraGMM estimation8

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryMore general moment conditions (2)instruments may vary with error termsE [z1 e1 (b)] 0E [z2 e2 (b)] 0gmm (e1 (b)) (e2 (b)) , instruments(1:z1 ) instruments(2:z2 ) nologthis computes the twostep GMM estimator without addinginformation on the rst stepyou can use this syntax to estimate supply and demandfunctions simultaneouslyRicardo MoraGMM estimation9

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummarySeveral linear examples10Ricardo MoraGMM estimation

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryLinear regresssionAssume thatdepvar β0 β1 x 1 β2 x 2 vso that E [v x 1, x 2] 0ThenE [(depvar (β0 β1 x 1 β2 x 2))] 0E [x 1 (depvar (β0 β1 x 1 β2 x 2))] 0E [x 2 (depvar (β0 β1 x 1 β2 x 2))] 0The gmm command:gmm (depvar-x1*{b1}-x2*{b2}-{b3}), instruments(x1 x2) nologequivalently (names of the variables will be displayed in theoutput) and simpler to write:gmm (depvar-{xb:x1 x2}-{b0}), instruments(x1 x2) nologRicardo MoraGMM estimation11

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryEstimating OLS with gmm command. regress mpg gear ratio turn, rLinear regressionNumber of obs F( 2,71) Prob F R-squared Root MSE -- Robustmpg Coef.\Std. Err.tP t [95% Conf. Interval]------------- -------------gear ratio 3.0328841.5330611.980.052-.0239546.089721turn -.7330502.1204386-6.090.000-.9731979-.4929025cons ----------------gmm (mpg - {b1}*gear ratio - {b2}*turn - {b0}), instruments(gear ratio turn) nologFinal G\M\M criterion Q(b) 3.48e-32G\M\M estimationNumber of parameters 3Number of moments 3Initial weight matrix: UnadjustedG\M\M weight matrix:RobustNumber of obs ----------------------------- Robust Coef.\Std. Err.zP z [95% Conf. Interval]------------- -------------/b1 3.0328841.5016642.020.043.08967575.976092/b2 -.7330502.117972-6.210.000-.9642711/b0 ------------------Instruments for equation 1: gear ratio turn consRicardo MoraGMM estimation-.501829312

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummary2SLS and gmmgmm (depvar-{xb:x1 x2}-{b0}), instruments(z1 z2 z3) onestepivregress 2sls mpg gear ratio (turn weight length headroom)Instrumental variables (2SLS) regressionNumber of obsWald chi2(2)Prob chi2R-squaredRoot MSE --mpg Coef.Std. Err.zP z [95% Conf. Interval]------------- -------------turn -1.246426.2012157-6.190.000-1.640801-.8520502gear ratio -.31464991.697806-0.190.853-3.6422883.012988cons -----------------Instrumented: turnInstruments:gear ratio weight length headroom. gmm (mpg - {b1}*turn - {b2}*gear ratio - {b0}), instruments(gear ratio weight length headroom) onestep\Step 1Iteration 0:Iteration 1:Iteration 2:G\M\M criterion Q(b) G\M\M criterion Q(b) G\M\M criterion Q(b) 475.42283.16100633.16100633G\M\M estimationNumber of parameters 3Number of moments 5Initial weight matrix: UnadjustedNumber of obs ----------------------------- Robust Coef.Std. Err.zP z [95% Conf. Interval]------------- --------------1.632649-.8602019/b1 -1.246426.1970566-6.330.000/b2 -.31464991.863079-0.170.866-3.9662173.336917/b0 ------------------Instruments for equation 1: gear ratio weight length headroom consRicardo MoraGMM estimation13

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryLinear GMM and gmmgmm (depvar-{xb:x1 x2}-{b0}), instruments(z1 z2 z3) wmatrix(robust). ivregress gmm mpg gear ratio (turn weight length headroom)Instrumental variables (GMM) regressionGMM weight matrix: RobustNumber of obsWald chi2(2)Prob chi2R-squaredRoot MSE -- Robustmpg Coef.Std. Err.zP z [95% Conf. Interval]------------- urn -1.208549gear ratio .1303281.754990.070.941-3.309393.570046cons ------------------Instrumented: turnInstruments:gear ratio weight length headroom. gmm (mpg - {b1}*turn - {b2}*gear ratio - {b0}), instruments(gear ratio weight length headroom) wmatrix(robust) nologFinal G\M\M criterion Q(b) .0074119G\M\M estimationNumber of parameters 3Number of moments 5Initial weight matrix: UnadjustedG\M\M weight matrix:RobustNumber of obs ----------------------------- Robust Coef.Std. Err.zP z [95% Conf. Interval]------------- -------------/b1 -1.208549.1882903-6.420.000-1.577591-.8395071/b2 .1303281.754990.070.941-3.309393.570046/b0 ------------------Instruments for equation 1: gear ratio weight length headroom consRicardo MoraGMM estimation14

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryNonlinear GMM15Ricardo MoraGMM estimation

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryExponential regression with exogenous regressorsexponential regression models are frequently encountered inapplied workthey can be used as alternatives to linear regression models onlog-transformed dependent variableswhen the dependent variable represents a discrete countvariable, they are also known as Poisson regression modelsE [y x ] exp (x β β0 )Moment conditions: E [x (y exp (x β β0 ))] 0this is equivalent to E [x (y exp (x β ) γ)] 0gmm (depvar-exp({xb:x1 x2}) {b0}), instruments(x1 x2) wmatrix(robust) 16Ricardo MoraGMM estimation

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummaryIV Poisson regression and otherssuppose now E [z (y exp (x β ) γ)] 0gmm (depvar-exp({xb:x1 x2}) {b0}), instruments(z1 z2 z3) wmatrix(robust)the structure of the moment conditions for some models is toocomplicated for the syntax used thus faryou should in these cases use the moment-evaluator programsyntax (see help gmm)17Ricardo MoraGMM estimation

MotivationUsing the gmm commandSeveral linear examplesNonlinear GMMSummarySummaryStata can compute the GMM estimators for some linearmodels:1regression with exogenous instruments using(ivreg,2ivreg2 for Stata 9)xtabond for dynamic panel dataivregresssince Stata 11, it is possible to obtain GMM estimates ofnon-linear models using the gmm command18Ricardo MoraGMM estimation

MIT OpenCourseWarehttps://ocw.mit.edu14.382 EconometricsSpring 2017For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.19

Motivation Using the gmm command Several linear examples Nonlinear GMM Summary. The syntax of gmm with instruments. If

Related Documents:

Motivation MM & IV GMM & 2SLS Asymptotics Testing GMM & ML Outline 1 Motivation 2 MM & IV 3 GMM & 2SLS 4 Asymptotics 5 Testing 6 GMM & ML Anton Velinov Single-Equation Generalized Method of Moments (GMM) 2/28

Stata is available in several versions: Stata/IC (the standard version), Stata/SE (an extended version) and Stata/MP (for multiprocessing). The major difference between the versions is the number of variables allowed in memory, which is limited to 2,047 in standard Stata/IC, but can be much larger in Stata/SE or Stata/MP. The number of

Categorical Data Analysis Getting Started Using Stata Scott Long and Shawna Rohrman cda12 StataGettingStarted 2012‐05‐11.docx Getting Started Using Stata – May 2012 – Page 2 Getting Started in Stata Opening Stata When you open Stata, the screen has seven key parts (This is Stata 12. Some of the later screen shots .

To open STATA on the host computer, click on the “Start” Menu. Then, when you look through “All Programs”, open the “Statistics” folder you should see a folder that says “STATA”. Click on the folde r and it will open up three STATA programs (STATA 10, STATA 11, and STATA 12). These are all the

There are several versions of STATA 14, such as STATA/IC, STATA/SE, and STATA/MP. The difference is basically in terms of the number of variables STATA can handle and the speed at which information is processed. Most users will probably work with the “Intercooled” (IC) version. STATA runs on the Windows, Mac, and Unix computers platform.

Stata/MP, Stata/SE, Stata/IC, or Small Stata. Stata for Windows installation 1. Insert the installation media. 2. If you have Auto-insert Notification enabled, the installer will start auto-matically. Otherwise, you will want to navigate to your installation media and double-click on Setup.exe to start the installer. 3.

Stata/IC and Stata/SE use only one core. Stata/MP supports multiple cores, but only commands are speeded up. . I am using Stata 14 and not Stata 15) Setting up the seed using dataset lename. type can be F create creates a dataset with empty seeds for each variation. If option fill is used, then seeds are random numbers.

graded readers end at around the 3,000 word-family level. Note that this figure differs from Nation (2001) who considered this level to con- tain only the first 2,000 word families. In Table 3, the mid-frequency vocabulary con-sists of around 6,000 word families, which when added to high-frequency vocabulary adds up to 9,000 word families. The reason for making the arbitrary cut-off point .