Generalized Method of Moments Estimation PDF
Generalized Method of Moments Estimation PDF
Generalized Method of Moments Estimation PDF
Stata 11
David M. Drukker
StataCorp
Stata Conference
Washington, DC 2009
1 / 27
Outline
2 gmm examples
Ordinary least squares
Two-stage least squares
Cross-sectional Poisson with endogenous covariates
Fixed-effects Poisson regression
2 / 27
A quick introduction to GMM
E [y − µ] = 0
Estimators that solve sample moment equations to produce
estimates are called method-of-moments (MM) estimators
This method dates back to Pearson (1895)
3 / 27
A quick introduction to GMM
7 / 27
gmm examples Ordinary least squares
9 / 27
gmm examples Ordinary least squares
Sorted by:
10 / 27
gmm examples Ordinary least squares
We specify that
We want to model
11 / 27
gmm examples Ordinary least squares
OLS by GMM I
Robust
Coef. Std. Err. z P>|z| [95% Conf. Interval]
12 / 27
gmm examples Ordinary least squares
OLS by GMM II
Robust
crime Coef. Std. Err. t P>|t| [95% Conf. Interval]
13 / 27
gmm examples Two-stage least squares
IV and 2SLS
For some variables, the assumption E [ǫ|x] = 0 is too strong and
we need to allow for E [ǫ|x] 6= 0
If we have q variables z for which E [ǫ|z] = 0 and the correlation
between z and x is sufficiently strong, we can estimate β from
the population moment conditions
E [z(y − xβ)] = 0
z are known as instrumental variables
If the number of variables in z and x is the same (q = k),
solving the the sample moment conditions yields the MM
estimator known as the instrumental variables (IV) estimator
If there are more variables in z than in x (q > k) and we let
P −1
N
W= z′
i =1 i zi in our GMM estimator, we obtain the
two-stage least-squares (2SLS) estimator
14 / 27
gmm examples Two-stage least squares
15 / 27
gmm examples Two-stage least squares
2SLS by GMM I
Robust
Coef. Std. Err. z P>|z| [95% Conf. Interval]
16 / 27
gmm examples Two-stage least squares
2SLS by GMM II
Robust
crime Coef. Std. Err. z P>|z| [95% Conf. Interval]
Instrumented: policepc
Instruments: legalwage arrestp
convictp
17 / 27
gmm examples Cross-sectional Poisson with endogenous covariates
18 / 27
gmm examples Cross-sectional Poisson with endogenous covariates
Sorted by:
19 / 27
gmm examples Cross-sectional Poisson with endogenous covariates
Robust
Coef. Std. Err. z P>|z| [95% Conf. Interval]
20 / 27
gmm examples Fixed-effects Poisson regression
21 / 27
gmm examples Fixed-effects Poisson regression
22 / 27
gmm examples Fixed-effects Poisson regression
. use xtaccidents
. describe
Contains data from xtaccidents.dta
obs: 5,000
vars: 7 31 May 2008 19:50
size: 160,000 (98.5% of memory free)
id float %9.0g
male float %9.0g
t float %9.0g
kids float %9.0g
cvalue float %9.0g
tickets float %9.0g
accidents float %9.0g
Sorted by: id t
. by id: egen max_a = max(accidents )
. drop if max_a ==0
(3750 observations deleted)
24 / 27
gmm examples Fixed-effects Poisson regression
program xtfe
version 11
syntax varlist if, at(name)
quietly {
tempvar mu mubar ybar
generate double ‘mu’ = exp(kids*‘at’[1,1] ///
+ cvalue*‘at’[1,2] ///
+ tickets*‘at’[1,3]) ‘if’
egen double ‘mubar’ = mean(‘mu’) ‘if’, by(id)
egen double ‘ybar’ = mean(accidents) ‘if’, by(id)
replace ‘varlist’ = accidents ///
- ‘mu’*‘ybar’/‘mubar’ ‘if’
}
end
25 / 27
gmm examples Fixed-effects Poisson regression
FE Poisson by gmm
Robust
Coef. Std. Err. z P>|z| [95% Conf. Interval]
26 / 27
gmm examples Fixed-effects Poisson regression
FE Poisson by xtpoisson, fe
27 / 27
References
Bibliography
Blundell, Richard, Rachel Griffith, and Frank Windmeijer. 2002.
“Individual effects and dynamics in count data models,” Journal of
Econometrics, 108, 113–131.
Cameron, A. Colin and Pravin K. Trivedi. 2005. Microeconometrics:
Methods and applications, Cambridge: Cambridge University Press.
Hansen, L. P. 1982. “Large-sample properties of Generalized
Method-of-Moment Estimators,” Econometrica, 1029–1054.
Hausman, Jerry A., Bronwyn H. Hall, and Zvi Griliches. 1984.
“Econometric Models for Count Data with an Application to the
Patents-R&D Relationship,” Econometrica, 52(4), 909–938.
Mullahy, J. 1997. “Instrumental variable estimation of Poisson
Regression models: Application to models of cigarette smoking
behavior,” Review of Economics and Statistics, 79, 586–593.
Pearson, Karl. 1895. “Contributions to the mathematical theory of
evolution—II. Skew variation in homogeneous material,”
27 / 27
gmm examples Fixed-effects Poisson regression
27 / 27