[R] binom and negbinom
Troels Ring
tring at mail1.stofanet.dk
Mon Sep 25 17:45:50 CEST 2000
Dear friends. In Carlin and Louis "Bayes and emperical Bayes methods.."
1996 the classical example of 12 independent tosses of a fair coin
producing 9 heads and 3 tails is given. If the situation is seen as a fixed
sample of 12, a binomial lieklihood is used, and Carlin et al reports a
probability of 0.075.
Using sum(dbinom(9:12,12,.5)) I obtain 0.073
Likewise, if the experiment is seen as continuing until 3 tails are noted,
a negative binomial is used, and the authors find P = 0.0325, whereas
sum(dnbinom(9:1000,3,.5)) gives 0.0327.
These differences may be small - but who is right, either R or Carlin - or
did I do it wrong ?
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