Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: matrix not positive definite with fixed effects and clustering


From   "Schaffer, Mark E" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: matrix not positive definite with fixed effects and clustering
Date   Thu, 28 Sep 2006 22:13:40 +0100

Daniel,

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Daniel H. Simon
> Sent: 28 September 2006 22:08
> To: [email protected]
> Subject: Re: st: RE: matrix not positive definite with fixed 
> effects and clustering
> 
> Mark - when I do this, I see that I do have 25 singleton 
> observations. 
> Moreover, I get the error message that the number of clusters 
> must be greater than the number of instruments (although I am 
> not specifying any endog variables that I'm instrumenting 
> for).

You should update your versions of ivreg2 and xtivreg2.  The handling of
this case is better in the newest versions.  Since you don't have any
excluded instruments, the reference to the number of instruments means
simply the number of regressors ... but I wouldn't be surprised if the
error message disappears after you update.

> I will try and eliminate the singleton obs and see if 
> this helps.

xtivreg2 drops these automatically, I think, so that won't matter.

--Mark

> Regarding the number of clusters, I can run the 
> same regression with a slightly different combination of rhs 
> variables, and it will run (with the same number of clustered 
> units)... 
> thanks again. Daniel
> 
> At 04:52 PM 9/28/2006, you wrote:
> >Daniel,
> >
> > > -----Original Message-----
> > > From: [email protected]
> > > [mailto:[email protected]] On Behalf Of Daniel 
> > > Simon
> > > Sent: 28 September 2006 20:01
> > > To: [email protected]
> > > Subject: st: matrix not positive definite with fixed effects and 
> > > clustering
> > >
> > > Hi - I am running -areg- with a bunch of additional fixed 
> effects, 
> > > which I am using -xi- to create, and clustered standard 
> errors. In 
> > > some specifications, I get the error message "matrix not positive 
> > > definite." I get the same message when I use -xtreg, fe- 
> instead of 
> > > areg. But, I do not get this message when I run the same model 
> > > without clustering.
> >
> >I am pretty sure the only matrix involved is the variance-covariance 
> >matrix, so there is something that is causing problems with the 
> >clust-robust vcv.  I wonder if this is a symptom of a singleton 
> >observation problem, i.e., you have a panel group with only one 
> >observation in it?  If you try estimating with xtivreg2, you 
> might (or 
> >might not!) get a more informative error message.
> >
> >HTH,
> >Mark
> >
> >Prof. Mark Schaffer
> >Director, CERT
> >Department of Economics
> >School of Management & Languages
> >Heriot-Watt University, Edinburgh EH14 4AS tel 
> +44-131-451-3494 / fax 
> >+44-131-451-3296
> >email: [email protected]
> >web: http://www.sml.hw.ac.uk/ecomes
> >
> > > In addition, I do not get this message when I drop some of the 
> > > xi-created fixed effects.
> > > I include the output with the error message below. Can anyone 
> > > provide me with an intuitive explanation for why the clustering 
> > > and/or the fixed effects cause this problem, and whether there is 
> > > any solution. thanks. Daniel
> > >
> > > . xi:areg  lncirc currentsite pgcurrentsites1 lnpubcirc1
> > > pubmags   markets
> > > lnissues chgpub   i.groupyr i.pub   , absorb(mag1) cluster(mag1)
> > > i.groupyr         _Igroupyra3-622     (naturally coded;
> > > _Igroupyra3 omitted)
> > > i.pub             _Ipuba5-959         (naturally coded;
> > > _Ipuba5 omitted)
> > > matrix not positive definite
> > > r(506);
> > >
> > > . xi:xtreg  lncirc currentsite pgcurrentsites1 lnpubcirc1
> > > pubmags   markets
> > > lnissues chgpub   i.groupyr i.pub   , fe i(mag1) cluster(mag1)
> > > i.groupyr         _Igroupyra3-622     (naturally coded;
> > > _Igroupyra3 omitted)
> > > i.pub             _Ipuba5-959         (naturally coded;
> > > _Ipuba5 omitted)
> > >
> > >
> > > Here it is without clustering:
> > >
> > > . xi:areg  lncirc currentsite pgcurrentsites1 lnpubcirc1
> > > pubmags   markets
> > > lnissues chgpub   i.groupyr i.pub   , absorb(mag1)
> > > i.groupyr         _Igroupyra3-622     (naturally coded;
> > > _Igroupyra3 omitted)
> > > i.pub             _Ipuba5-959         (naturally coded;
> > > _Ipuba5 omitted)
> > >
> > > Linear regression, absorbing indicators                Number
> > > of obs =    5011
> > >
> > > F(597,  3800) =    3.36
> > >                                                         Prob
> > > > F      =  0.0000
> > >
> > > R-squared     =  0.9886
> > >                                                         Adj 
> > > R-squared =  0.9849
> > >                                                         Root
> > > MSE      =   .1639
> > >
> > > --------------------------------------------------------------
> > > ----------------
> > >        lncirc |      Coef.   Std. Err.      t    P>|t|
> > > [95% Conf. Interval]
> > > -------------+------------------------------------------------
> > > ----------
> > > -------------+------
> > >   currentsite |  -.0353274   .0113278    -3.12   0.002
> > > -.0575366   -.0131183
> > > pgcurrents~1 |   .0005656   .0040061     0.14   0.888
> > > -.0072888    .0084199
> > >    lnpubcirc1 |   .0218753    .003488     6.27   0.000
> > > .0150368    .0287138
> > >       pubmags |  -.0036036   .0013778    -2.62   0.009
> > > -.0063048   -.0009023
> > >       markets |   .0029789   .0033642     0.89   0.376
> > > -.0036169    .0095748
> > >      lnissues |   .1162314   .0224666     5.17   0.000
> > > .0721835    .1602792
> > >        chgpub |  -.0099665   .0447696    -0.22   0.824
> > > -.0977412    .0778081
> > >   _Igroupyra4 |  -.0222715   .0980753    -0.23   0.820
> > > -.2145569    .1700139
> > > ...
> > >
> > > *
> > > *   For searches and help try:
> > > *   http://www.stata.com/support/faqs/res/findit.html
> > > *   http://www.stata.com/support/statalist/faq
> > > *   http://www.ats.ucla.edu/stat/stata/
> > >
> > >
> >
> >*
> >*   For searches and help try:
> >*   http://www.stata.com/support/faqs/res/findit.html
> >*   http://www.stata.com/support/statalist/faq
> >*   http://www.ats.ucla.edu/stat/stata/
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index