subjectiveBfZStat: A subjective Bayes factor for the two-sample Z-test

View source: R/zTest.R

subjectiveBfZStatR Documentation

A subjective Bayes factor for the two-sample Z-test

Description

Based on conjugate priors with a total of 6 hyperparameters.

Usage

subjectiveBfZStat(
  x1,
  s21,
  n1,
  x2,
  s22,
  n2,
  sigma = 1,
  a1 = 5,
  b1 = 2,
  a2 = -5,
  b2 = 2,
  a0 = 0,
  b0 = 1,
  log = FALSE
)

Arguments

x1

numeric, sample mean of group 1

s21

numeric, sample variance of group 1

n1

integer sample size of group 1

x2

numeric, sample mean of group 2

s22

numeric, sample variance of group 2

n2

integer sample size of group 2

sigma

numeric > 0, population standard deviation

a1

numeric, prior mean of the population mean mu1 of group 1

b1

numeric > 0, prior standard deviation of the population mean mu1 of group 1

a2

numeric, prior mean of the population mean mu2 of group 2

b2

numeric > 0, prior standard deviation of the population mean mu2 of group 2

a0

numeric, prior mean of the overall population mean mu0 of both groups

b0

numeric > 0, prior standard deviation of the population mean mu0 of both groups

log

logical, default FALSE, if TRUE then return logarithm of the subjective Bayes factor outcome

Value

numeric > 0 representing the subjective Bayes factor outcome in favour of the alternative over the null

Examples

subjectiveBfZStat(5.2, 2, 3, 3.4, 2, 12)

safestats documentation built on Sept. 6, 2026, 1:06 a.m.