[R] Odds ratio in fisher.test()

About this list Date view Thread view Subject view Author view Attachment view

From: Andrew Criswell (arc@arcriswell.com)
Date: Wed 26 Feb 2003 - 15:10:41 EST


Message-id: <003401c2dd4d$092316b0$4dd994cb@andrewhdh0e5oe>

Hello:

Please help me through my confusion. I am having trouble reconciling the
difference between what I believe is the conventional definition of an
odds ratio for a 2-by-2 table and the output produced by fisher.test()
in R. Consider the following example:

> Discrim <- matrix(c(1,10,24,17),
+ nr = 2,
+ dimnames = list(AGE = c('young', 'old'),
+ EMPLOY = c('fired', 'kept')))
> Discrim
       EMPLOY
AGE fired kept
  young 1 24
  old 10 17

The conventional odds ratio is computed as

> (1 * 17) / (24 * 10)
[1] 0.07083333

Why is it, when I use fisher.test(), I get an estimated odds ratio like
that reported below? There, the difference seems slight, but with other
cases it can be quite large.

> fisher.test(Discrim, alternative = 'two.sided')

        Fisher's Exact Test for Count Data

data: Discrim
p-value = 0.005242
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
 0.001573963 0.606416320
sample estimates:
odds ratio
0.07407528

Thanks,
ANDREW

______________________________________________
R-help@stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:23 EST