No subject
Troels Ring
tring at mail1.stofanet.dk
Thu Sep 14 22:24:12 CEST 2000
Dear friends.
I wanted to get an impression of the odds ratio of two treatments:
1) 11 survival 4 deaths
2) 5 survival 9 deaths
I know I could use
library(ctest)
s <-
matrix(c(11,4,5,9),nr=2,dimnames=list(c("Survived","Death"),c("New","Standard")))
fisher.test(s)
to get a p value of 0.0656 and 95% CI of OR of
0.8108857 32.5251110
but wanted instead a bayesian estimate using prior beta(1,1) for both
treatments.
I came up with
x1 <- seq(0,1,by=0.01)
x2 <- seq(0,1,by=0.01)
post1 <- dbeta(x1,12,5)
post2 <- dbeta(x2,6,10)
ORR <- (post1/(1-post1))/(post2/(1-post2))
ORR <- ORR[!is.na(ORR)]
but this did not behave well at all.
I thought I would get about the same mean for OR (4.656126) as with Fisher
test - but not at all.
How can I sample from the distribution of the OR in a proper way ?
Best wishes
Troels
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list