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 and "few observations" error... with same N sometimes it works sometimes it does not


From   "Claudio Baccianti" <[email protected]>
To   <[email protected]>
Subject   st: GMM and "few observations" error... with same N sometimes it works sometimes it does not
Date   Thu, 11 Jul 2013 10:56:10 +0200

Dear Stata users,
 
I encountered the "cannot have fewer observations than parameters"
error message when running the GMM command, both on Stata 12.1 and 11.2
(Windows 32bit).
 
I have a loop that runs the GMM on N separate sectoral datasets. Each
dataset represents a panel for one sector and they all have the same
number of observations. The loop works fine until one point, when it
stops giving the error message r(2001) "cannot have fewer observations
than parameters". The sector that gets stuck has 378 obs, exactly the
same number of the previous successful ones. That is really strange.
 
Here is the gmm command I am using:
 
...
foreach j of local sector{
use datasect`j', clear
[...]
gmm (eq1:Y1 - {b1}*X1 - {du1: c1-c26}) (eq2:Y2 - {b1}*X2 - {du2:
c1-c26}) (eq3:Y3 - {b1}*X3 - {du3: c1-c26}), instruments(eq1: L1.X1
c1-c26, noconstant) instruments(eq2: L1.X2 c1-c26, noconstant)
instruments(eq3: L1.X3 c1-c26, noconstant) wmatrix(hac bartlett 1)
winitial(identity) vce(hac bartlett 1)
[...]
}
 
where c* are dummy variables.
 
Claudio
 
 

Zentrum für Europäische Wirtschaftsforschung GmbH (ZEW), L7,1 68161
Mannheim 
Sitz der Gesellschaft: Mannheim - Amtsgericht  Mannheim HRB 6554
Aufsichtsratsvorsitzende: Ministerin Theresia Bauer MdL -
Geschaeftsfuehrer: Prof. Dr. Clemens Fuest, Thomas Kohl 
Centre for European Economic Research L7,1 68161 Mannheim Germany
Seat of the Company: Mannheim - Local Court Mannheim HRB 6554
Chairwoman of the Supervisory Board: Minister Theresia Bauer MdL -
Executive Directors: Prof. Dr. Clemens Fuest, Thomas Kohl
--------------------------------------------------------------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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