Dear all
I have a very punctual question about the relationship between GMM estimation and Non-linear least squares. For the latter, let's take the particular case of an exponential conditional expectation
where x is a (column) vector of covariates (let's assume orthogonal to the error) and b is the vector of coefficients of interest. Written in an error-term-form, by the law of iterated expectations, this conditional expectation leads to
So say that I have a random sample, a simple cross-section. Let's take the doctor-visits dataset as in Cameron and Trivedi (2005) Micreconometrics methods and applications
where for comparability, we take as dependent docvis and as independent variables private, chronic, female and income. I know I can fit this model directly via nls (with Robust standard errors)
Now, I am aware that to fit the same model using gmm interactively I need to specify the generalized residual. In this additive model (and using the impliaction of the zero conditional mean assumption on the error term) the moment conditions are
which leads to the following gmm syntax
Yet this differs from results using nls and in turn, it provides the same results as if I fit the model via poisson
which, I am aware, occurs because in expression (1) we have the implicit moments from the score of the log-likelihood function using the Poisson distribution (an equivalence that does not hold, for instance, for the probit model, as show in Stata's GMM documentation manual).
Hence, in the additive model y=exp(x'b) + u, how can I replicate the results from nls for an exponential conditional expectation using the gmm command?
Any insight on this will be greatly appreciated
JM
I have a very punctual question about the relationship between GMM estimation and Non-linear least squares. For the latter, let's take the particular case of an exponential conditional expectation
E(y|x)=exp(x'b)
where x is a (column) vector of covariates (let's assume orthogonal to the error) and b is the vector of coefficients of interest. Written in an error-term-form, by the law of iterated expectations, this conditional expectation leads to
y=exp(x'b) + u
So say that I have a random sample, a simple cross-section. Let's take the doctor-visits dataset as in Cameron and Trivedi (2005) Micreconometrics methods and applications
Code:
use https://www.stata-press.com/data/r16/docvisits, clear
Code:
gen one=1 nl (docvis = exp({xb: private chronic female income one})), variables(docvis private chronic female income) robust
E[x(docvis - exp( b1*private + b2*chronic + b3*female + b4*income + cons ))] = 0 (1)
which leads to the following gmm syntax
Code:
gmm (docvis - exp({xb:private chronic female income _cons})), instruments(private chronic female income) onestep
Code:
poisson docvis private chronic female income, robust
Hence, in the additive model y=exp(x'b) + u, how can I replicate the results from nls for an exponential conditional expectation using the gmm command?
Any insight on this will be greatly appreciated
JM
Comment