ciBA: Bayesian method of CI estimation with different or same...

View source: R/101.Confidence_base_n.R

ciBAR Documentation

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

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.

Details

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

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

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

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)

RajeswaranV/proportion documentation built on June 17, 2022, 9:11 a.m.