Learn R Programming

BayesPower (version 1.0.1)

BF10.bin.test: Bayes factor for a Bayesian one-proportion test

Description

Calculate the Bayes factor (BF10) for a test of a single proportion, either against a point null or an interval null hypothesis.

Usage

BF10.bin.test(x, n, alpha, beta, location, scale, model, hypothesis, e = NULL)

Value

The Bayes factor (BF10) for the one-proportion test.

Arguments

x

Observed number of successes.

n

Sample size.

alpha

Parameter for the analysis beta prior under the alternative hypothesis.

beta

Parameter for the analysis beta prior under the alternative hypothesis.

location

Null proportion value.

scale

Scale parameter for the analysis prior (if applicable, e.g., for Moment prior).

model

Statistical model of the analysis prior under the alternative hypothesis: beta prior ("beta") or Moment prior ("Moment").

hypothesis

The hypothesis being tested: two-sided ("!="), right-sided (">"), or left-sided ("<").

e

Optional numeric vector specifying bounds for an interval null; used if interval BF is calculated.

Examples

Run this code
BF10.bin.test(
  x = 12,
  n = 50,
  alpha = 2,
  beta = 3,
  location = 0.5,
  scale = 1,
  model = "beta",
  hypothesis = "!="
)

Run the code above in your browser using DataLab