Learn R Programming

BayesPower (version 1.0.2)

BF10.props: Bayes factor for comparing two proportions

Description

Compute the Bayes factor (BF10) for a Bayesian test of two proportions.

Usage

BF10.props(a0, b0, a1, b1, a2, b2, n1, n2, x1, x2)

Value

A list of class BFvalue_2p containing:

  • type: the string "Two-proportions".

  • analysis_h0: list with a and b for the null prior.

  • analysis_h1_theta_1: list with a and b for group 1 prior under H1.

  • analysis_h1_theta_2: list with a and b for group 2 prior under H1.

  • bf10: the computed Bayes factor (BF10).

  • n1, x1, n2, x2: the input sample sizes and observed successes.

  • OddRatio: observed odd ratio.

  • p.value: p.value.

Arguments

a0

Numeric scalar. Alpha parameter of the Beta prior under the null hypothesis.

b0

Numeric scalar. Beta parameter of the Beta prior under the null hypothesis.

a1

Numeric scalar. Alpha parameter of the Beta prior for group 1 under the alternative hypothesis.

b1

Numeric scalar. Beta parameter of the Beta prior for group 1 under the alternative hypothesis.

a2

Numeric scalar. Alpha parameter of the Beta prior for group 2 under the alternative hypothesis.

b2

Numeric scalar. Beta parameter of the Beta prior for group 2 under the alternative hypothesis.

n1

Numeric integer. Sample size for group 1.

n2

Numeric integer. Sample size for group 2.

x1

Numeric integer. Number of successes observed in group 1.

x2

Numeric integer. Number of successes observed in group 2.

Examples

Run this code
BF10.props(
a0 = 1,
b0 = 1,
a1 = 1,
b1 = 1,
a2 = 1,
b2 = 1,
n1 = 493,
n2 = 488,
x1 = 155,
x2 = 150)

Run the code above in your browser using DataLab