Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: bugs using _all


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: bugs using _all
Date   Mon, 11 Jul 2005 00:34:45 +0100

Indeed. The sort index is one variable 
and so is part of _all. Here it shows up 
as __000000. So, whether you get results 
or not, -logit _all- is to be avoided. 
So too is -logit *-. 

Other than 

logit vote-black 

there are various automated ways of 
throwing all variables at -logit-. 

One is 

unab all : * 
logit `all' 

but that is more a Stata point than a 
recommendation. 

Nick 
[email protected] 

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Jun Xu
> Sent: 11 July 2005 00:15
> To: [email protected]
> Subject: RE: st: RE: bugs using _all
> 
> 
> Nick,
> 
> Thanks! I think I willl be more cautious using these terms. 
> Following is 
> another example, and as you said, it is related to a temp var.
> 
> . use "H:\data\cps5000.dta", clear
> (register00all.dta is obtained by data managing register00.dta.)
> 
> . keep  vote white black
> 
> . logit _all
> 
> Iteration 0:   log likelihood = -3097.9733
> Iteration 1:   log likelihood = -3084.2206
> Iteration 2:   log likelihood = -3084.2127
> 
> Logistic regression                               Number of 
> obs   =       
> 4583
>                                                   LR chi2(3)  
>     =      
> 27.52
>                                                   Prob > chi2 
>     =     
> 0.0000
> Log likelihood = -3084.2127                       Pseudo R2   
>     =     
> 0.0044
> 
> --------------------------------------------------------------
> ----------------
>         vote |      Coef.   Std. Err.      z    P>|z|     [95% Conf. 
> Interval]
> -------------+------------------------------------------------
> ----------------
>        white |    .580768   .1150094     5.05   0.000     .3553539    
> .8061822
>        black |   .3906235   .1460116     2.68   0.007     
> .1044459     
> .676801
>     __000000 |  -1.01e-06   .0000209    -0.05   0.961     
> -.000042      
> .00004
>        _cons |  -.1424608   .1204319    -1.18   0.237     -.378503    
> .0935814
> --------------------------------------------------------------
> ----------------
> 
> . logit vote white black
> 
> Iteration 0:   log likelihood = -3097.9733
> Iteration 1:   log likelihood = -3084.2217
> Iteration 2:   log likelihood = -3084.2139
> 
> Logistic regression                               Number of 
> obs   =       
> 4583
>                                                   LR chi2(2)  
>     =      
> 27.52
>                                                   Prob > chi2 
>     =     
> 0.0000
> Log likelihood = -3084.2139                       Pseudo R2   
>     =     
> 0.0044
> 
> --------------------------------------------------------------
> ----------------
>         vote |      Coef.   Std. Err.      z    P>|z|     [95% Conf. 
> Interval]
> -------------+------------------------------------------------
> ----------------
>        white |   .5805815   .1149446     5.05   0.000     .3552941    
> .8058688
>        black |   .3904015   .1459396     2.68   0.007     .1043651    
> .6764379
>        _cons |  -.1448309   .1100522    -1.32   0.188    -.3605292    
> .0708673
> --------------------------------------------------------------
> ----------------
> 
> .
> 
> 
> 
> 
> Jun Xu
> Ph.D. Candidate
> Department of Sociology
> Indiana University at Bloomington
> http://mypage.iu.edu/~junxu/home
> 
> 
> 
> 
> >From: "Nick Cox" <[email protected]>
> >Reply-To: [email protected]
> >To: <[email protected]>
> >Subject: st: RE: bugs using _all
> >Date: Sun, 10 Jul 2005 22:30:38 +0100
> >
> >The Statalist FAQ advises this:
> >
> >--------------------
> >Don't say "Is this a bug?". Almost all the time, it is not!
> >--------------------
> >
> >However, you have, I guess been bitten by something
> >designed to protect you.
> >
> >When you type -logit-, you fire up a wrapper program
> >which, among other things, creates a temporary variable
> >recording the sort order, so that your data can be
> >left in their current sort order when -logit- is done.
> >
> >This temporary variable is thus part of _all when
> >-logit- passes the ball. Evidently it is true that
> >your data order are in the sort order of your response
> >variable, so -logit- bails out for the reason given.
> >
> >This is fixable by StataCorp, although I am not
> >sure how keen they will be to do it. The code to
> >fix it is embedded within -egen.ado-, for which
> >the fix is arguably more important.
> >
> >The easiest fix is just not to do this, in the way
> >that you have demonstrated. In most circumstances,
> >firing all the variables at a binary response is
> >likely to be poor science. I guess in your case
> >it just seemed a neat short-cut.
> >
> >I can't comment on your other cases not documented
> >here.
> >
> >Nick
> >[email protected]
> >
> >Jun Xu
> >
> > > Could be that I missed something, but it might be a bug. 
> I found that
> > > sometimes, I will get weird results or simply refusal to
> > > estimate a simple
> > > logit model. For example (lfp is the first variable in the list),
> > >
> > > . logit _all
> > >
> > > outcome = __000000 > 325 predicts data perfectly
> > > r(2000);
> > >
> > > . logit lfp-inc
> >
> >*
> >*   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/
> 
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search! 
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
> 
> *
> *   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