On Mon, Jul 11, 2011 at 12:22 PM, Jason Hecht <jhecht58@gmail.com> wrote:
> Is it possible to estimate a matrix of correlation coefficients for
> explanatory variables used in a GMM model in STATA?
I am not sure why you need this, given that you have -correlate-...
but here's an example:
sysuse auto
reg mpg weight foreign
corr weight foreign
gmm (mpg - {b1}*weight - {b2}*length - {b0}) ( weight - {mw=3020} )
(length - {ml=187} ) ( (weight-{mw})^2 - {vw=6e5} ) ( (length-{ml})^2
- {vl=400}) ( (weight-{mw})*(length-{ml}) - sqrt({vw}*{vl})*{corrwl} )
, instruments( 1: weight length) winit(unadj, indep)
All equations are exactly identified in this example, but you'd have
to specify non-zero starting values for the variance parameters,
otherwise the minimizer cannot leave the zero defaults.
--
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I use this email account for mailing lists only.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/