Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: curious behaviour of -glm-


From   "Mak, Timothy" <timothy.mak07@imperial.ac.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: curious behaviour of -glm-
Date   Thu, 4 Jun 2009 13:29:56 +0100

Hi list, 

 

I'm just curious why -glm, fam(bin) - doesn't seem to handle certain extreme scenarios in accordance with other Stata commands, like give you appropriate warning messages...

 

Eg. 

 

. input r n

 

             r          n

  1. 10 100

  2. end

 

. glm r, fam(bin n)

insufficient observations

r(2001);

 

The model should be estimable... 

 

Also: 

 

 

. input r n x

 

             r          n          x

  1. 10 100 1

  2. 0 100 0

  3. end

 

. glm r x, fam(bin n)

 

Iteration 0:   log likelihood = -2.2079271  

Iteration 1:   log likelihood = -2.0261494  

Iteration 2:   log likelihood = -2.0259832  

Iteration 3:   log likelihood =  -2.025974  

Iteration 4:   log likelihood =  -2.025974  

 

Generalized linear models                          No. of obs      =         2

Optimization     : ML                              Residual df     =         0

                                                   Scale parameter =         1

Deviance         =  2.00000e-08                    (1/df) Deviance =         .

Pearson          =  1.00000e-08                    (1/df) Pearson  =         .

 

Variance function: V(u) = u*(1-u/n)                [Binomial]

Link function    : g(u) = ln(u/(n-u))              [Logit]

 

                                                   AIC             =  4.025974

Log likelihood   = -2.025973987                    BIC             =  2.00e-08

 

------------------------------------------------------------------------------

             |                 OIM

           r |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

-------------+----------------------------------------------------------------

           x |   23.87722      10000     0.00   0.998    -19575.76    19623.52

       _cons |  -26.07444      10000    -0.00   0.998    -19625.71    19573.56

------------------------------------------------------------------------------

 

The model runs as if there was convergence, but of course there can't be... 

 

Tim



*
*   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/



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