Bayesian analysis of the binomial parameters for two samples.
Bayesian analysis of the binomial parameters for two samples.
This function computes the posterior distributions of the binomial parameters π[1] and π[2] when given the numbers of ``successes'' and the sample sizes for the two samples. It uses uniform priors. A plot of the posterior distributions of the two π's is produced, and a plot of the posterior distribution of π[1]−π[2]
with its 95% credible interval.
B2props(s, n, alpha =0.05)
Arguments
s: a vector containing the 2 numbers of sampling units with the feature ("success")
n: a vector containing the 2 numbers of sampling units examined
alpha: 1 - level of credibility, so that for alpha = 0.05 (the default) credible intervals will have 95% credibility
Returns
None, the inferred difference between the probabilities and its 95% credible interval is calculated and several plots are produced
References
van Hulst, R. 2018. Evaluating Scientific Evidence. ms.