Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • cci 6 2 0 7, exact. Cornfield Estimates vs add Haldane-Anscombe adjustment - Who knew an OR would be so interesting?

    Hi All,

    I conducted a small CC study for a nosocomial food-borne outbreak. The results are:


    Code:
    cci 6 2 0 7, exact
    
                                                             Proportion
                     |   Exposed   Unexposed  |      Total      exposed
    -----------------+------------------------+------------------------
               Cases |         6           2  |          8       0.7500
            Controls |         0           7  |          7       0.0000
    -----------------+------------------------+------------------------
               Total |         6           9  |         15       0.4000
                     |                        |
                     |      Point estimate    |    [95% conf. interval]
                     |------------------------+------------------------
          Odds ratio |                .       |    3.436748           . (Cornfield)
     Attr. frac. ex. |                1       |    .7090272           . (Cornfield)
     Attr. frac. pop |              .75       |
                     +-------------------------------------------------
                                      1-sided Fisher's exact P = 0.0056
                                      2-sided Fisher's exact P = 0.0070
    This gives an undefined upper 95% ci and lower 85% ci of 3.4. This is fine but left me curious since I am used to the "traditional way" of calculating the 95% Ci using:

    95% CI = eln(OR) +-1.96√(1/a + 1/b + 1/c + 1/d)

    However, both the upper and lower 95% Ci are undefined since the OR is undefined.

    While I am okay with Stata output and generally understand the interpretation, I was curious at how it was able to define the lower Ci so i ventured down the epitab to find the cornfield method and popped it into the wolfram app and calculated the lower Ci to be 1.8 (link at the end of post).

    This made me uneasy since stating "the cornfield" method might not be reproducible for many...atleast, it was not for me...

    So I wanted to find a way of calculating 95% Ci using the "traditional method" and found that the Haldane-Anscombe adjustment of adding fixed effects (usually 0.5) deals with this robustly and crucially for me, allows the OR to be calculated in the traditional way. Stata's immediate calculator rejects non-integer values and so comparing the Cornfield vs Haldane-Ansocme adjustment become a bit more laborious than expected. i could add a fixed effect of 1 but this may cause a larger bias towards the null (already a criticism of the adjustment.

    Code:
    cci 6.5 2.5 0.5 7.5, exact 
    '6.5' found where integer expected
    For interest sake, this results:
    Total
    Exposed Unexposed
    Cases 6.5 2.5 9
    Control 0.5 7.5 8
    Total 7 10 17
    OR Point estimate 95% Ci lower 95% Ci upper
    39.00 1.57 969.24
    p- value 0.0254
    Anyway, my supervisors don't seem to have a clear idea on how they would deal with this so I decided to invite the forum's inputs.

    So, what would you do?

    Cheers
    Brian

    PS advice like "you should have sample exposed controls" is not particularly helpful at this point.

    Links to wolfram app
    Wolfram calculation of lower 95% Ci using Cornfield method

    https://www.wolframalpha.com/input?i...5D%5D+%3D0.025

    *this calculation does not give the same estimate as stata. This is still under investigation.
    Wolfram calculation of upper 95% Ci using Cornfield method

    https://www.wolframalpha.com/input?i...%5D+%3D1-0.025

    Wolfram calculation of lower 95% Ci using traditional method

    https://www.wolframalpha.com/input?i...%5C%2841%29%5D
    Wolfram calculation of upper 95% Ci using Cornfield method

    https://www.wolframalpha.com/input?i...%5C%2841%29%5D


  • #2
    The thing that bothers me with these ad hoc corrections in a sparse sample like this is that they end up having a huge influence over the estimated OR and its precision. Ultimately you know the OR is undefined and its precision by approximate methods approaches infinity.

    You could try to use penalized logistic regression (or a Bayesian analog) which has the benefit of being able to converge when separation exists, as it does here. I would -search firthlogit- for one implementation. You will still probably get a huge OR, but it will be estimable in theory.

    Comment


    • #3
      With sparse data you get an imprecise estimate. I'm not sure that that makes the estimate any more interesting or worthy of agonizing over. Using the official Stata exlogistic and two user-written commands (see output below), the estimates (tabulated below) are all within about what you'd expect of each other.

      Method OR LB UB
      exlogistic 20 2
      firthlogit 40 3 6000
      penlogit1 40 3 2000
      penlogit2 30 2 5000
      LB, UB = 95% confidence bounds; penlogit1 = normal(0, 10) prior; penlogit2 = log-F(0, 1, 1, 1) prior

      .ÿ
      .ÿversionÿ17.0

      .ÿ
      .ÿclearÿ*

      .ÿ
      .ÿinputÿbyte(outÿgrpÿcount)

      ÿÿÿÿÿÿÿÿÿÿoutÿÿÿÿÿÿÿgrpÿÿÿÿÿcount
      ÿÿ1.ÿ0ÿ0ÿ7
      ÿÿ2.ÿ1ÿ0ÿ2
      ÿÿ3.ÿ0ÿ1ÿ0
      ÿÿ4.ÿ1ÿ1ÿ6
      ÿÿ5.ÿend

      .ÿ
      .ÿccÿoutÿgrpÿ[fweight=count],ÿexact

      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿgrpÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿProportion
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿExposedÿÿÿUnexposedÿÿ|ÿÿÿÿÿÿTotalÿÿÿÿÿÿexposed
      -----------------+------------------------+------------------------
      ÿÿÿÿÿÿÿÿÿÿÿCasesÿ|ÿÿÿÿÿÿÿÿÿ6ÿÿÿÿÿÿÿÿÿÿÿ2ÿÿ|ÿÿÿÿÿÿÿÿÿÿ8ÿÿÿÿÿÿÿ0.7500
      ÿÿÿÿÿÿÿÿControlsÿ|ÿÿÿÿÿÿÿÿÿ0ÿÿÿÿÿÿÿÿÿÿÿ7ÿÿ|ÿÿÿÿÿÿÿÿÿÿ7ÿÿÿÿÿÿÿ0.0000
      -----------------+------------------------+------------------------
      ÿÿÿÿÿÿÿÿÿÿÿTotalÿ|ÿÿÿÿÿÿÿÿÿ6ÿÿÿÿÿÿÿÿÿÿÿ9ÿÿ|ÿÿÿÿÿÿÿÿÿ15ÿÿÿÿÿÿÿ0.4000
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿPointÿestimateÿÿÿÿ|ÿÿÿÿ[95%ÿconf.ÿinterval]
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|------------------------+------------------------
      ÿÿÿÿÿÿOddsÿratioÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.ÿÿÿÿÿÿÿ|ÿÿÿÿ3.436748ÿÿÿÿÿÿÿÿÿÿÿ.ÿ(Cornfield)
      ÿAttr.ÿfrac.ÿex.ÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ1ÿÿÿÿÿÿÿ|ÿÿÿÿ.7090272ÿÿÿÿÿÿÿÿÿÿÿ.ÿ(Cornfield)
      ÿAttr.ÿfrac.ÿpopÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.75ÿÿÿÿÿÿÿ|
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ+-------------------------------------------------
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ1-sidedÿFisher'sÿexactÿPÿ=ÿ0.0056
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ2-sidedÿFisher'sÿexactÿPÿ=ÿ0.0070

      ÿNote:ÿExactÿconfidenceÿlevelsÿnotÿpossibleÿwithÿzeroÿcountÿcells.

      .ÿ
      .ÿexlogisticÿoutÿgrpÿ[fweight=count],ÿnolog
      note:ÿCMLEÿestimateÿforÿgrpÿisÿ+inf;ÿcomputingÿMUE.

      ExactÿlogisticÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿÿÿÿÿÿÿÿÿ15
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿModelÿscoreÿÿÿ=ÿÿÿ8.166667
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿPrÿ>=ÿscoreÿÿÿ=ÿÿÿÿÿ0.0070
      ---------------------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿoutÿ|ÿOddsÿratioÿÿÿÿÿÿÿSuff.ÿÿ2*Pr(Suff.)ÿÿÿÿÿ[95%ÿconf.ÿinterval]
      -------------+-------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿgrpÿ|ÿÿÿ17.27956*ÿÿÿÿÿÿÿÿÿÿ6ÿÿÿÿÿÿ0.0112ÿÿÿÿÿÿ1.812866ÿÿÿÿÿÿÿ+inf
      ---------------------------------------------------------------------------
      (*)ÿmedianÿunbiasedÿestimatesÿ(MUE)

      .ÿ
      .ÿquietlyÿfirthlogitÿoutÿi.grpÿ[fweight=count],ÿnolog

      .ÿppl
      95%ÿCIÿLBÿ=ÿ1.0679888ÿORÿ=ÿ2.9095219
      95%ÿCIÿUBÿ=ÿ8.6730116ÿORÿ=ÿ5843.0697

      .ÿquietlyÿestimatesÿrestoreÿUnconstrained

      .ÿfirthlogitÿ,ÿor

      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿÿÿÿÿ15
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWaldÿchi2(1)ÿÿ=ÿÿÿ4.99
      Penalizedÿlogÿlikelihoodÿ=ÿ-7.0780083ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿ=ÿ0.0254

      ------------------------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿoutÿ|ÿOddsÿratioÿÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
      -------------+----------------------------------------------------------------
      ÿÿÿÿÿÿÿ1.grpÿ|ÿÿÿÿÿÿÿÿÿ39ÿÿÿ63.93122ÿÿÿÿÿ2.23ÿÿÿ0.025ÿÿÿÿÿ1.569359ÿÿÿÿ969.1855
      ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.3333333ÿÿÿ.2434323ÿÿÿÿ-1.50ÿÿÿ0.132ÿÿÿÿÿ.0796616ÿÿÿÿ1.394789
      ------------------------------------------------------------------------------
      Note:ÿ_consÿestimatesÿbaselineÿodds.

      .ÿ
      .ÿpenlogitÿoutÿgrpÿ[fweight=count],ÿorÿnprior(grpÿ0ÿ10)ÿppl(grp)


      PenalizedÿlogisticÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNo.ÿofÿobsÿÿ=ÿÿÿÿÿÿÿÿÿ15

      Normalÿpriorÿforÿgrp:ÿexactÿpriorÿmedianÿORÿ(95%ÿPL):ÿ1.00ÿ(0.00,ÿ492.71)
      Dataÿapprox.ÿequivalentÿtoÿprior:ÿcases=0.53ÿÿnoncases=0.53ÿÿexp(offset)=1

      Penalizedÿlogÿlikelihoodÿ=ÿ-9.867014

      ------------------------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿoutÿ|ÿOddsÿRatioÿÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
      -------------+----------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿgrpÿ|ÿÿÿÿ42.0245ÿÿÿ67.13519ÿÿÿÿÿ2.34ÿÿÿ0.019ÿÿÿÿÿ1.835214ÿÿÿÿ962.3176
      ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.3582299ÿÿÿ.2651434ÿÿÿÿ-1.39ÿÿÿ0.165ÿÿÿÿÿ.0839742ÿÿÿÿ1.528191
      ------------------------------------------------------------------------------
      --------------------------------------
      ÿÿÿÿÿÿÿÿÿoutÿ|ÿ[95%ÿPLÿConf.ÿInterval]
      -------------+------------------------
      ÿÿÿÿÿÿÿÿÿgrpÿ|ÿÿÿÿ3.115304ÿÿÿÿ2433.693
      --------------------------------------

      .ÿ
      .ÿpenlogitÿoutÿgrpÿ[fweight=count],ÿorÿlfprior(grpÿ0ÿ1ÿ1ÿ1)ÿppl(grp)


      PenalizedÿlogisticÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNo.ÿofÿobsÿÿ=ÿÿÿÿÿÿÿÿÿ15

      Log-Fÿpriorÿforÿgrp:ÿexactÿpriorÿmedianÿORÿ(95%ÿPL):ÿ1.00ÿ(0.00,ÿ647.79)
      Dataÿapprox.ÿequivalentÿtoÿprior:ÿcases=0.50ÿÿnoncases=0.50ÿÿexp(offset)=1

      Penalizedÿlogÿlikelihoodÿ=ÿ-6.8299418

      ------------------------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿoutÿ|ÿOddsÿRatioÿÿÿStd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
      -------------+----------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿgrpÿ|ÿÿÿ31.20028ÿÿÿ50.72349ÿÿÿÿÿ2.12ÿÿÿ0.034ÿÿÿÿÿ1.289222ÿÿÿÿ755.0737
      ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.3780314ÿÿÿ.2802326ÿÿÿÿ-1.31ÿÿÿ0.189ÿÿÿÿÿ.0884173ÿÿÿÿ1.616288
      ------------------------------------------------------------------------------
      --------------------------------------
      ÿÿÿÿÿÿÿÿÿoutÿ|ÿ[95%ÿPLÿConf.ÿInterval]
      -------------+------------------------
      ÿÿÿÿÿÿÿÿÿgrpÿ|ÿÿÿÿ2.461649ÿÿÿÿ4629.794
      --------------------------------------

      .ÿ
      .ÿexit

      endÿofÿdo-file


      .


      Ad hoc ppl computes likelihood-profile 95% confidence bounds for firthlogit; the Wald CIs shown in the regression table should be ignored. ppl and the command that it calls are attached.
      Code:
      search penlogit
      for that user-written command.
      Attached Files

      Comment

      Working...
      X