Learn R Programming

evidence (version 0.8.10)

B2props: Bayesian analysis of the binomial parameters for two samples.

Description

This function computes the posterior distributions of the binomial parameters \(\pi[1]\) and \(\pi[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 \(\pi\)'s is produced, and a plot of the posterior distribution of \(\pi[1] - \pi[2]\) with its 95% credible interval.

Usage

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

Value

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.

See Also

B1prop

prop.test

Examples

Run this code
# NOT RUN {
B2props(c(13, 22), c(78, 92))
# }

Run the code above in your browser using DataLab