ciBAx: Bayesian method of CI estimation with Beta prior distribution

Description Usage Arguments Details Value References See Also Examples

View source: R/103.ConfidenceIntervals_BASE_n_x.R

Description

Bayesian method of CI estimation with Beta prior distribution

Usage

1
ciBAx(x, n, alp, a, b)

Arguments

x

- Number of sucess

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 the given x and n. based on the conjugate prior β(a, b) for the probability of success p of the binomial distribution so that the posterior is β(x + a, n - x + b).

Value

A dataframe with

x

- Number of successes (positive samples)

LBAQx

- Lower limits of Quantile based intervals

UBAQx

- Upper limits of Quantile based intervals

LBAHx

- Lower limits of HPD intervals

UBAHx

- Upper limits of HPD intervals

References

[1] 1993 Vollset SE. Confidence intervals for a binomial proportion. Statistics in Medicine: 12; 809 - 824.

[2] 1998 Agresti A and Coull BA. Approximate is better than "Exact" for interval estimation of binomial proportions. The American Statistician: 52; 119 - 126.

[3] 1998 Newcombe RG. Two-sided confidence intervals for the single proportion: Comparison of seven methods. Statistics in Medicine: 17; 857 - 872.

[4] 2001 Brown LD, Cai TT and DasGupta A. Interval estimation for a binomial proportion. Statistical Science: 16; 101 - 133.

[5] 2002 Pan W. Approximate confidence intervals for one proportion and difference of two proportions Computational Statistics and Data Analysis 40, 128, 143-157.

[6] 2008 Pires, A.M., Amado, C. Interval Estimators for a Binomial Proportion: Comparison of Twenty Methods. REVSTAT - Statistical Journal, 6, 165-197.

[7] 2014 Martin Andres, A. and Alvarez Hernandez, M. Two-tailed asymptotic inferences for a proportion. Journal of Applied Statistics, 41, 7, 1516-1529

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 Base methods of CI estimation given x & n: PlotciAllxg, PlotciAllx, PlotciEXx, ciASx, ciAllx, ciEXx, ciLRx, ciLTx, ciSCx, ciTWx, ciWDx

Examples

1
2
3
4
x=5; n=5; alp=0.05; a=0.5;b=0.5;
ciBAx(x,n,alp,a,b)
x= 5; 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)
ciBAx(x,n,alp,a,b)

Example output

  x     LBAQx     UBAQx     LBAHx UBAHx
1 5 0.6206229 0.9999066 0.6942544     1
  x     LBAQx     UBAQx     LBAHx     UBAHx
1 5 0.6206229 0.9999066 0.6942544 1.0000000
2 5 0.4734903 0.9681460 0.5240839 0.9894935
3 5 0.5407419 0.9957893 0.6069622 1.0000000
4 5 0.5407419 0.9957893 0.6069622 1.0000000
5 5 0.4734903 0.9681460 0.5240839 0.9894935
6 5 0.6206229 0.9999066 0.6942544 1.0000000

proportion documentation built on May 1, 2019, 7:54 p.m.