B1prop: Bayesian analysis of the binomial parameter for one sample.

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/B1prop.R

Description

This function computes the posterior distribution of the binomial probability π when given the number of “successes” and the sample size, as well as one of a choice of priors. A plot of the posterior distribution is produced with the 95% credible interval of π.

Usage

1
2
B1prop(s, n, p = 0.5, alpha = 0.05, prior = c("uniform", "near_0.5",
  "not_near_0.5", "near_0", "near_1", "custom"), params = NULL)

Arguments

s

the number of sampling units with the feature

n

the number of sampling units examined

p

an optional hypothesized probability

alpha

1 - alpha is the desired level of credibility of a credible interval

prior

one of: "uniform", "near_0.5", "not_near_0.5", "near_0", "near_1", "custom", which are all beta distributions with appropriate parameter values. Note that if prior="custom" the following argument has to be supplied:

params

a vector with the a and b parameters of the custom beta prior

Value

the posterior probability

Author(s)

Robert van Hulst

References

van Hulst, R. 2018. Evaluating Scientific Evidence. ms.

See Also

B2props

prop.test

Examples

1
B1prop(13, 100, .1, prior="near_0")

evidence documentation built on May 2, 2019, 2:14 p.m.