Statalist


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

Re: st: Strange behavior from conditional logistic - bug?


From   Ricardo Ovaldia <ovaldia@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Strange behavior from conditional logistic - bug?
Date   Fri, 26 Oct 2007 12:33:52 -0700 (PDT)

Thank you Jeff. I assumed that was the case. However,
should the -e()- results be clear if the regression
fails?

The reason I am concerned is that I wrote a program to
do a series of -clogit- and produce a table of odds
ratios and CI. I use -cap clogit- so that when ever
the model failed it would not stop the run, but would
output missing values for the OR and CI. However, e(b)
and e(V) are not missing, and the table looks like all
models worked.

I will modify the program to capture the return code,
but this is something that can easily "bite" even
experienced users. I see no justification for this
strange behavior. I assume this also happens with
other estimators.

Thank you,
Ricardo.

--- "Jeff Pitblado, StataCorp LP"
<jpitblado@stata.com> wrote:

> Ricardo Ovaldia <ovaldia@yahoo.com> is using
> -clogit- but it exited with the
> error 'Hessian has become unstable or asymmetric'
> while working on the first
> iteraction.  He asks why there are -e()- results
> present when -clogit- exited
> with an error.
> 
> -clogit- uses -logit- to compute initial values
> before calling -ml- to fit the
> model.  The -e()- results Ricardo noticed are from
> this call to -logit-.
> 
> --Jeff
> jpitblado@stata.com
> 
>
-----------------------------------------------------------------------------
> Original message from Ricardo Ovaldia
> <ovaldia@yahoo.com>:
> 
> > I am not sure what is going on here, but this does
> not
> > look correct. My conditional logistic regression
> fails
> > with a "Hessian has become unstable or asymmetric"
> > error message, however the return list and the
> > coefficient matrices are populated:
> > 
> > . use cdata.dta, clear
> > . mat drop _all
> > . eret clear
> > . cap noi mat list e(b)
> > matrix e(b) not found
> > 
> > . clogit case expose, group(race)
> > note: multiple positive outcomes within groups
> > encountered.
> > 
> > Iteration 0:   log likelihood = -939.77277  
> > Hessian has become unstable or asymmetric
> > r(504);
> > 
> > . mat list e(b)
> > 
> > e(b)[1,2]
> >        expose      _cons
> > y1  .04772761  .71262832
> > 
> > . eret list
> > 
> > scalars:
> >                   e(N) =  1514
> >                e(ll_0) =  -954.663128837389
> >                  e(ll) =  -954.5735647746089
> >                e(df_m) =  1
> >                e(chi2) =  .1791281255600552
> >                e(r2_p) =  .0000938174525386
> >               e(N_cdf) =  0
> >               e(N_cds) =  0
> > 
> > macros:
> >             e(cmdline) : "logit __000002 expose if
> > __000001 , "
> >               e(title) : "Logistic regression"
> >                 e(vce) : "oim"
> >              e(depvar) : "__000002"
> >                 e(cmd) : "logit"
> >            e(crittype) : "log likelihood"
> >             e(predict) : "logit_p"
> >          e(properties) : "b V"
> >           e(estat_cmd) : "logit_estat"
> >            e(chi2type) : "LR"
> > 
> > matrices:
> >                   e(b) :  1 x 2
> >                   e(V) :  2 x 2
> >               e(rules) :  1 x 4
> > 
> > functions:
> >              e(sample)   
> > 
> > 
> > The hessian becoming unstable or asymmetric is
> also
> > strange. Race has 3 levels and >60 observations
> per
> > race.
> 
> *
> *   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/
> 


Ricardo Ovaldia, MS
Statistician 
Oklahoma City, OK

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index