[R] Is it safe? Cochran etc

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sun Oct 10 20:19:44 CEST 2004


Dan Bolser <dmb at mrc-dunn.cam.ac.uk> writes:

> OK, we are 'allowed' to use an approximation, but what am I approximating,
> and how does this relate to fishers exact test for 2x2 table?

The odd thing is that FEXACT is giving up way before it needs to on
this example. According to my calculations, an array of length 507
should suffice! You can get the exact p value as 

> phyper(1, 13725, 879208, 507)+ phyper(16,13725,879208,507,low=F)
[1] 0.006098377

(This happens to be the same whether you use tail-balancing or
likelihood criterion to define the two-sided test)

And of course with huge numbers in one column, you have a very good
approximation in treating the ratio as known:

> binom.test(1,507, 13714/(13714+878702))

        Exact binomial test

data:  1 and 507
number of successes = 1, number of trials = 507, p-value = 0.006112
alternative hypothesis: true probability of success is not equal to
0.01536727
95 percent confidence interval:
 4.993526e-05 1.094002e-02
sample estimates:
probability of success
           0.001972387


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list