[R] What package to use to calculate odds ratio and the confidence interval?

Viechtbauer Wolfgang (STAT) wolfgang.viechtbauer at maastrichtuniversity.nl
Tue Aug 14 21:37:59 CEST 2012


This is not an odds ratio. You simply calculated 27/131 = .206, which is the odds of having the disease given <40%. You can calculate a confidence interval for this with:

exp(log(27/131) - 1.96 * sqrt(1/27 - 1/(27+131)))
exp(log(27/131) + 1.96 * sqrt(1/27 - 1/(27+131)))

which yields (0.146, 0.291).

Wolfgang
________________________________________
From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of C W [tmrsg11 at gmail.com]
Sent: Tuesday, August 14, 2012 9:06 PM
To: Nordlund, Dan (DSHS/RDA)
Cc: r-help
Subject: Re: [R] What package to use to calculate odds ratio and the confidence interval?

The table did not come out on rich text format.

So what I wrote was,

                     <40%    >40%  Total
No disease      131         75     206
Have diease      27           6      33
                                             239

My odds ratio: 27/(27+131))/(131/(27+131)) = 0.206
I am looking for the confidence interval.

Mike


More information about the R-help mailing list