Learn R Programming

proportion (version 2.0.0)

ciBA: Bayesian method of CI estimation with different or same parameteric values

Description

Bayesian method of CI estimation with different or same parameteric values for Beta prior distribution

Usage

ciBA(n, alp, a, b)

Arguments

n
- Number of trials
alp
- Alpha value (significance level required)
a
- Shape parameter 1 for prior Beta distribution in Bayesian model. Can also be a vector of length n+1 priors.
b
- Shape parameter 2 for prior Beta distribution in Bayesian model. Can also be a vector of length n+1 priors.

Value

A dataframe with
x
- Number of successes (positive samples)
pomean
- Posterior mean
LBAQ
- Lower limits of Quantile based intervals
UBAQ
- Upper limits of Quantile based intervals
LBAH
- Lower limits of HPD intervals
UBAH
- Upper limits of HPD intervals

Details

Highest Probability Density (HPD) and two tailed intervals are provided for all \(xi = 0, 1, 2 ..n\) based on the conjugate prior \(\beta(ai, bi) (i = 1, 2..n+1)\) for the probability of success p of the binomial distribution so that the posterior is \(\beta(xi + ai, n - xi + bi)\).

References

[1] 2002 Gelman A, Carlin JB, Stern HS and Dunson DB Bayesian Data Analysis, Chapman & Hall/CRC [2] 2006 Ghosh M, Delampady M and Samanta T. An introduction to Bayesian analysis: Theory and Methods. Springer, New York

See Also

prop.test and binom.test for equivalent base Stats R functionality, binom.confint provides similar functionality for 11 methods, wald2ci which provides multiple functions for CI calculation , binom.blaker.limits which calculates Blaker CI which is not covered here and propCI which provides similar functionality.

Other Basic methods of CI estimation: PlotciAS, PlotciAllg, PlotciAll, PlotciBA, PlotciEX, PlotciLR, PlotciLT, PlotciSC, PlotciTW, PlotciWD, ciAS, ciAll, ciEX, ciLR, ciLT, ciSC, ciTW, ciWD

Examples

Run this code
n=5; alp=0.05; a=0.5;b=0.5;
ciBA(n,alp,a,b)
n=5; alp=0.05; a=c(0.5,2,1,1,2,0.5);b=c(0.5,2,1,1,2,0.5)
ciBA(n,alp,a,b)

Run the code above in your browser using DataLab