B1prop {evidence} | R Documentation |
This function computes the posterior distribution of the binomial
probability \pi
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 \pi
.
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)
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 |
the posterior probability
Robert van Hulst
van Hulst, R. 2018. Evaluating Scientific Evidence. ms.
B1prop(13, 100, .1, prior="near_0")