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]
Re: st: GMM with 93+ regressors produces error
From
Stas Kolenikov <[email protected]>
To
[email protected]
Subject
Re: st: GMM with 93+ regressors produces error
Date
Sat, 26 Feb 2011 16:34:58 -0500
This is not the limits of -gmm- issue, but that of perfect
collinearity. You have 93 groups, you generate 93 dummies, and you
still add {b0} on top of that. That ain't gonna be identified, sorry.
Dropping one variable should've given that away. No limits for -gmm-
are reported in -help limits-, although I would suspect that with
complicated expressions you might start hitting the limits on the # of
literals or operators in your expressions. (Some of my calls to -gmm-,
collected via cycles in local macros, expand to eight or so lines, but
still run.)
On Sat, Feb 26, 2011 at 4:08 PM, Julian Reif <[email protected]> wrote:
> 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/
>
--
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/