GMM Estimation STATA
GMM Estimation STATA
Ricardo Mora
Department of Economics
Universidad Carlos III de Madrid
Master in Industrial Economics and Markets
Outline
1 Motivation
4 Nonlinear GMM
Motivation
E [h1 (b)] = 0
E [h2 (b)] = 0
gmm (h1 (b)) (h2 (b)), igmm
E [z1 e1 (b)] = 0
E [z2 e2 (b)] = 0
gmm (e1 (b)) (e2 (b)) , instruments(1:z1 ) instruments(2:z2 ) nolog
Linear regresssion
Assume that
depvar = β0 + β1 x 1 + β2 x 2 + v
so that E [v |x 1, x 2] = 0
Then
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
The gmm command:
gmm (depvar-x1*{b1}-x2*{b2}-{b3}), instruments(x1 x2) nolog
------------------------------------------------------------------------------
| 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
------------------------------------------------------------------------------
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
------------------------------------------------------------------------------
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
------------------------------------------------------------------------------
| 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
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
Nonlinear GMM
E [y |x ] = exp (x β + β0 )
Summary