Statalist The Stata Listserver


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

Re: st: Fwd: Blogit vs logit and cc


From   wgould@stata.com (William Gould, Stata)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Fwd: Blogit vs logit and cc
Date   Mon, 05 Jun 2006 08:12:39 -0500

Dominic Muston <dom.muston@googlemail.com> has the following data:

        . list

             +--------------------------+
             | exposed   outcome     n  |
             |--------------------------|
          1. |       0         0   184  |
          2. |       0         1    21  |
          3. |       1         0   174  |
          4. |       1         1    30  |
             +--------------------------+

He reports he types 

	. logit outcome exposed [weight=n], or
	<some output omitted>
        -------------------------------------------------------...
             outcome | Odds Ratio   Std. Err.      z    P>|z|  ...
        -------------+-----------------------------------------...
             exposed |   1.510673   .4585442     1.36   0.174  ...
        -------------------------------------------------------...

Or if he types -cc outcome exposed [fweight=n]" he gets a similar 
1.51 odds ratio.

But, he reports, if he types -blogit outcome n exposed, or- he gets a 
different answer.  Dominic writes, 

> It's going to be something really obvious isn't it?

Yes.

-blogit- wants counts for the positive-outcome variable; -blogit- wants the
number of positive outcomes, not a 0/1 variable.  Rather than 
the second observation of the data reporting 21 trials, outcome=1, 
-blogit- wants to hear 21 trials, 21 positive outcomes:

	. gen cnt = outcome*n

	. blogit cnt n exposed, or
	<some output omitted>
        -------------------------------------------------------...
            _outcome | Odds Ratio   Std. Err.      z    P>|z|  ...
        -------------+-----------------------------------------...
             exposed |   1.510673   .4585442     1.36   0.174  ...
        -------------------------------------------------------...

-- Bill
wgould@stata.com

P.S.  Actually, Dominic said he tried the -blogit- command with the 
      -noconstant- option.  -noconstant- is not necessary.  When you 
      specify the -or- option, the intercept is not reported, but it 
      is included in the model, as it should be.

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