binom_bayes: Bayesian analysis of one-sample binomial data using conjugate...

View source: R/binom.bayes.r

binom_bayesR Documentation

Bayesian analysis of one-sample binomial data using conjugate beta priors

Description

Bayesian analysis of one-sample binomial data using conjugate beta priors

Usage

binom_bayes(
  x,
  n,
  a = 1,
  b = 1,
  level = 0.95,
  null,
  plot = FALSE,
  add = FALSE,
  xlab = "p",
  ylab = "Posterior density",
  col = "blue",
  ...
)

Arguments

x

Number of "successes"

n

Number of trials

a

'alpha' parameter for beta prior. Default: uniform prior

b

'beta' parameter for beta prior. Default: uniform prior

level

For posterior interval; .95 for a 95% credible interval

null

Point null to evaluate as a kind of hypothesis test

plot

Draw a plot? Default: false

add

Add to existing plot? Default: false

xlab

xlab for plot

ylab

ylab for plot

col

color of density line for plot

...

Additional arguments to plot()

Examples

binom_bayes(10, 16)
binom_bayes(0, 21, plot=TRUE)

pbreheny/breheny documentation built on April 26, 2024, 10:40 a.m.