Statalist


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

RE: st: What does -koopmani- output? odds ratios or risk ratios?


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: What does -koopmani- output? odds ratios or risk ratios?
Date   Sun, 15 Mar 2009 17:06:25 -0000

Roger is correct. Among other things, -koopmani- works with a scalar called m. 

As documented in 

SJ-6-2  dm0021  . Stata tip 31: Scalar or variable? Problem of ambiguous names
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  G. I. Kolev
        Q2/06   SJ 6(2):279--280                                 (no commands)
        tips for avoiding abbreviation conflicts with variables
        when naming scalars

-- and in the manual entries it refers to -- scalars and variables share the same name space. Thus given a reference to "m", Stata tries first to make sense of it as a reference to a variable. 

Roger's example points up directly and indirectly how this works with the auto dataset. Stata, on behalf of -koopmani-, sees "m" as a possible abbreviation for -make- and -mpg-, but complains about ambiguity. Drop -make- and Stata does not complain but it still produces nonsense because it interprets m as a reference to -mpg-, meaning -mpg[1]- which only by a freakish coincidence will contain the same number as the scalar m. 

The main advice: don't do that! Using temporary names is much better practice. 

As -koopmani- was published in the STB, we'll encourage the author to fix this (and bring the program presentation and documentation up-to-date too). 

Nick 
n.j.cox@durham.ac.uk
(also wearing an Editor SJ hat) 

Roger Harbord

-koopmani- seems to have a programming issue as well as that labelling issue:

. sysuse auto, clear
(1978 Automobile Data)

. koopmani 36 40 16 80

m ambiguous abbreviation
r(111);

. drop make

. koopmani 36 40 16 80

                 |            Event       |            Proportion
                 |       Yes          No  |     Total         Yes
-----------------+------------------------+----------------------
          Group1 |        36         -14  |        22      1.6364
          Group2 |        16          64  |        80      0.2000
-----------------+------------------------+----------------------
           Total |        52          50  |       102      0.5098
                 |                        |
                 |      Point estimate    |  [95% Conf. Interval]
-----------------|------------------------+----------------------
      Odds Ratio |         8.181818       |  7.313014    12.16772
-----------------------------------------------------------------

. drop _all

. koopmani 36 40 16 80

                 |            Event       |            Proportion
                 |       Yes          No  |     Total         Yes
-----------------+------------------------+----------------------
          Group1 |        36           4  |        40      0.9000
          Group2 |        16          64  |        80      0.2000
-----------------+------------------------+----------------------
           Total |        52          68  |       120      0.4333
                 |                        |
                 |      Point estimate    |  [95% Conf. Interval]
-----------------|------------------------+----------------------
      Odds Ratio |              4.5       |  2.939633    7.152252
-----------------------------------------------------------------


I suspect koopmani.ado would benefit from some -tempvar- or tempname-
statements.

Maarten Buis 

> I assume you refer to this -koopmani-:
> STB-58  sg154 . Conf. int. for ratio of two binomial prop. by Koopman's method (help koopman if installed) .. . . . . . . . . . . . . .  D. Wang
>        11/00   pp.16--19; STB Reprints Vol 10, pp.244--247
>
> From the helpfile of -koopmani-: "koopman computes the confidence
> intervals for the ratio of two binomial proportions", so it is a risk
> ratio not an odds ratio.

Tiago Pereira 

Working with -koopmani-, one types:

.  koopmani 36 40 16 80

and gets:


                 |            Event       |            Proportion
                 |       Yes          No  |     Total         Yes
-----------------+------------------------+----------------------
          Group1 |        36           4  |        40      0.9000
          Group2 |        16          64  |        80      0.2000
-----------------+------------------------+----------------------
           Total |        52          68  |       120      0.4333
                 |                        |
                 |      Point estimate    |  [95% Conf. Interval]
-----------------|------------------------+----------------------
      Odds Ratio |              4.5       |  2.939633    7.152252
-----------------------------------------------------------------


That estimate of 4.5 is actually the risk ratio, isn´t it? Or am I doing a big confusion?

. cci 36 4 16 64


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