Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: GMM with 93+ regressors produces error


From   Julian Reif <[email protected]>
To   [email protected]
Subject   st: GMM with 93+ regressors produces error
Date   Sat, 26 Feb 2011 15:08:33 -0600

Is it possible to run -gmm- with more than 92 regressors?  I encounter the error "could not evaluate equation 1" when I try to do so.  The following logit example, run on Stata 11.1, reproduces the error:

-------------------
-------------------
clear all
set seed 38
set obs 93
gen id =  _n
expand 10
gen lhs = uniform() < 0.5
xi I.id

* These two commands should produce the same coefficient estimates. -gmm- produces an error here though.
logit lhs _I*
gmm (lhs - exp({xb: _I*}+{b0})/(1+exp({xb:}+{b0}))), instruments( _I*) onestep derivative(/xb = -1*( exp({xb:}+{b0}) / ((1+exp({xb:}+{b0}))^2) ))	derivative(/b0 = -1*( exp({xb:}+{b0}) / ((1+exp({xb:}+{b0}))^2) ))

* Dropping one regressor makes error message go away
drop if id==93
drop _Iid_93
logit lhs _I*
gmm (lhs - exp({xb: _I*}+{b0})/(1+exp({xb:}+{b0}))), instruments( _I*) onestep derivative(/xb = -1*( exp({xb:}+{b0}) / ((1+exp({xb:}+{b0}))^2) ))	derivative(/b0 = -1*( exp({xb:}+{b0}) / ((1+exp({xb:}+{b0}))^2) ))



Julian
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index