B2props function

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]\pi[1] and π[2]\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 π[1]π[2]\pi[1] - \pi[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.

Author(s)

Robert van Hulst

See Also

B1prop

prop.test

Examples

B2props(c(13, 22), c(78, 92))
  • Maintainer: Robert van Hulst
  • License: GPL (>= 2)
  • Last published: 2018-05-15

Useful links