Re: [R] replicating the odds ratio from a published study

From: Michael Dewey <>
Date: Sun 28 Jan 2007 - 13:57:27 GMT

At 22:01 26/01/2007, Peter Dalgaard wrote:
>Bob Green wrote:
>>Peetr & Michael,
>>I now see my description may have confused the issue. I do want to
>>compare odds ratios across studies - in the sense that I want to
>>create a table with the respective odds ratio for each study. I do
>>not need to statistically test two sets of odds ratios.
>>What I want to do is ensure the method I use to compute an odds
>>ratio is accurate and intended to check my method against published sources.
>>The paper I selected by Schanda et al (2004). Homicide and major
>>mental disorders. Acta Psychiatr Scand, 11:98-107 reports a total
>>sample of 1087. Odds ratios are reported separately for men and
>>women. There were 961 men all of whom were convicted of homicide.
>>Of these 961 men, 41 were diagnosed with schizophrenia. The
>>unadjusted odds ratio is for this group of 41 is cited as
>>6.52 (4.70-9.00). They also report the general population aged
>>over 15 with schizophrenia =20,109 and the total population =2,957,239.

Looking at the paper (which is in volume 110 by the way) suggests that Peter's reading of the situation is correct and that is what the authors have done.

>>Any further clarification is much appreciated,
>A fisher.test on the following matrix seems about right:
> > matrix(c(41,920,20109-41,2957239-20109-920),2)
> [,1] [,2]
>[1,] 41 20068
>[2,] 920 2936210
> > fisher.test(matrix(c(41,920,20109-41,2957239-20109-920),2))
> Fisher's Exact Test for Count Data
>data: matrix(c(41, 920, 20109 - 41, 2957239 - 20109 - 920), 2)
>p-value < 2.2e-16
>alternative hypothesis: true odds ratio is not equal to 1
>95 percent confidence interval:
>4.645663 8.918425
>sample estimates:
>odds ratio
> 6.520379
>The c.i. is not precisely the same as your source. This could be
>down to a different approximation (R's is based on the noncentral
>hypergeometric distribution), but the classical asymptotic formula gives
> > exp(log(41*2936210/920/20068)+qnorm(c(.025,.975))*sqrt(sum(1/M)))
>[1] 4.767384 8.918216
>which is closer, but still a bit narrower.

Michael Dewey mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon Jan 29 01:05:23 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 29 Jan 2007 - 02:30:25 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.