Calculate the Bayes factor (BF10) for a single-proportion test, either against a point null or an interval null hypothesis.
BF10.bin.test(
x,
n,
alpha,
beta,
h0,
scale,
prior_analysis,
alternative,
ROPE = NULL
)An object of class "BFvalue_bin" containing:
bf10: Bayes factor in favor of the alternative hypothesis.
type: Test type ("one-proportion").
x: Number of successes.
n: Sample size.
h0: Null proportion value.
analysis_h1: List describing the analysis prior, containing
prior (prior distribution), alpha (alpha parameter),
beta (beta parameter), and scale (scale parameter).
alternative: the direction of the alternative hypothesis.
ROPE: interval null bounds (if specified).
p.value: p-value.
Numeric integer. Observed number of successes (non-negative integer scalar, must be \(\le n\)).
Numeric integer. Sample size (positive integer scalar).
Numeric scalar. Shape parameter of the analysis beta prior under the alternative hypothesis
(required if prior_analysis = "beta").
Numeric scalar. Shape parameter of the analysis beta prior under the alternative hypothesis
(required if prior_analysis = "beta").
Numeric scalar. Null proportion value (numeric scalar between 0.1 and 0.9).
Numeric scalar. Scale parameter for the analysis prior (only used if prior_analysis = "Moment").
character. the analysis prior under the alternative hypothesis:
"beta" (stretched beta) or "Moment" (normal-moment prior).
character. Hypothesis being tested: two-sided ("two.sided"), right-sided ("greater"),
or left-sided ("less").
Numeric vector. Optional numeric vector specifying bounds for an interval null; used if interval BF is calculated.
BF10.bin.test(
x = 42,
n = 52,
h0 = 0.5,
prior_analysis = "beta",
alternative = "greater",
alpha = 1,
beta = 1)
Run the code above in your browser using DataLab