[R-sig-Epi] epitools::oddsratio error numbers close to zero in cells?

C.H. chainsawtiney at gmail.com
Fri Mar 5 02:48:57 CET 2010


It is possible to calculate the OR with non-zero cells using fisher.test

> m<-matrix(c(360,7,4,120),byrow=F,nrow=2,ncol=2)
> fisher.test(m)$estimate
odds ratio
  1419.605
> fisher.test(m)$conf.int
[1]  407.324 8192.000
attr(,"conf.level")
[1] 0.95

For cases with zero cell, it is a problem. A typical work round (by
usual software such as Revman, Prism or SPSS) is to add 0.5 to all
cells to prevent the problem of division of zero. I don't know if any
packages implemented this.



On Fri, Mar 5, 2010 at 9:02 AM, Pedro Emmanuel Alvarenga Americano do
Brasil <emmanuel.brasil at gmail.com> wrote:
> Hello all,
>
> I was runing some analysis here and found an error with epitools::oddsratio.
> First I tought it was in my data, later I tought I was running the function
> incorrectly but I now realize that there is something with numbers close to
> zero or cells with zero...
>
> below the same error with a simulated data... but it happens exactly the
> same with mine wich has one cell with 1.
>
>> m<-matrix(c(360,7,0,120),byrow=F,nrow=2,ncol=2)
>> m
>     [,1] [,2]
> [1,]  360    0
> [2,]    7  120
>> oddsratio(m)
> Erro em uniroot(function(or) { :
>  f() values at end points not of opposite sign
>
>> m<-matrix(c(360,7,4,120),byrow=F,nrow=2,ncol=2)
>> m
>     [,1] [,2]
> [1,]  360    4
> [2,]    7  120
>> oddsratio(m)
> Erro em uniroot(function(or) { :
>  f() values at end points not of opposite sign
>
>> m<-matrix(c(360,7,7,120),byrow=F,nrow=2,ncol=2)
>> m
>     [,1] [,2]
> [1,]  360    7
> [2,]    7  120
>> oddsratio(m)
> $data
>          Outcome
> Predictor  Disease1 Disease2 Total
>  Exposed1      360        7   367
>  Exposed2        7      120   127
>  Total         367      127   494
>
> $measure
>          odds ratio with 95% C.I.
> Predictor  estimate    lower upper
>  Exposed1   1.0000       NA    NA
>  Exposed2 806.1128 300.7302  2560
>
> $p.value
>          two-sided
> Predictor  midp.exact fisher.exact   chi.square
>  Exposed1         NA           NA           NA
>  Exposed2          0 1.896808e-96 4.400778e-94
>
> Is it impoossible to estimate OR confidence intervals with tables with very
> low numbers? Any work around sugestions?
>
> Abraço forte e que a força esteja com você,
>
> Dr. Pedro Emmanuel A. A. do Brasil
> Instituto de Pesquisa Clínica Evandro Chagas
> Fundação Oswaldo Cruz
> Rio de Janeiro - Brasil
>
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-Epi at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-epi
>
>



-- 
CH Chan
Research Assistant - KWH
http://www.macgrass.com



More information about the R-sig-Epi mailing list