View source: R/101.Confidence_base_n.R
ciBA | R Documentation |
Bayesian method of CI estimation with different or same parameteric values for Beta prior distribution
ciBA(n, alp, a, b)
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. |
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).
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 |
[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
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()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.