bfbinom | R Documentation |
Calculates Bayes Factors sequentially for dichotomous data, showing evidence evolution over time. Uses 'proportionBF' from the BayesFactor package to compute Bayes Factors starting from a minimum number of observations and updating with each new data point.
bfbinom(
data,
p = 0.5,
prior.r = 0.1,
alternative = c("two.sided", "greater", "less"),
nstart = 5,
exact = TRUE,
nullInterval = NULL
)
data |
A vector containing binary data (0s and 1s) |
p |
Probability of success under the null hypothesis (default: 0.5) |
prior.r |
Scale parameter for the prior distribution (default: 0.1) |
alternative |
Direction of alternative hypothesis: "two.sided", "greater", or "less" |
nstart |
Minimum number of data points before first BF calculation (>= 2) |
exact |
Logical. If TRUE, calculates BF for all points; if FALSE, uses steps for efficiency |
nullInterval |
Optional vector of length 2 for interval hypothesis testing (deprecated) |
A list of class "seqbf" containing:
probability of success: estimated probability
p-value: from classical binomial test
BF: vector of sequential Bayes Factors
test type: "binomial"
prior: list with prior distribution details
sample size: total number of observations
alternative: chosen alternative hypothesis
data <- rbinom(100, 1, 0.7)
result <- bfbinom(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.