[R] Re: your mail
thomas at biostat.washington.edu
Thu Sep 14 22:39:35 CEST 2000
On Thu, 14 Sep 2000, Troels Ring wrote:
> 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
> 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
> 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 ?
If the priors are independent Beta(1,1) then the posteriors are
independent Beta(12,5) and Beta(6,10), so you can eg
You might also find it illuminating to sample from your prior.
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