conjugateBfTStat: A "subjective" Bayes factor for the two-sample T-test

View source: R/tTest.R

conjugateBfTStatR Documentation

A "subjective" Bayes factor for the two-sample T-test

Description

Based on conjugate priors with a total of 8 hyperparameters.

Usage

conjugateBfTStat(
  x1,
  sdObs1,
  n1,
  x2,
  sdObs2,
  n2,
  a1 = 3.98,
  g1 = 0.03,
  a2 = 4.02,
  g2 = 0.05,
  a0 = 4,
  g0 = 2,
  aGamma = 2,
  bGamma = 1/2,
  log = FALSE
)

Arguments

x1

numeric, sample mean of group 1

sdObs1

numeric, the observed standard deviation of the first group.

n1

integer sample size of group 1

x2

numeric, sample mean of group 2

sdObs2

numeric, the observed standard deviation of the second group.

n2

integer sample size of group 2

a1

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

g1

numeric > 0, conditional prior variance of the population mean mu1 of group 1 is given by g1*sigma^2

a2

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

g2

numeric > 0, conditional prior variance of the population mean mu2 of group 2 is given by g2*sigma^2

a0

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

g0

numeric > 0, conditional prior variance of the population mean mu0 of both groups is given by g1*sigma^2

aGamma

numeric > 0, shape parameter of the prior on the standard deviation sigma

bGamma

numeric > 0, rate parameter of the prior on the standard deviation sigma

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

References

Ly, A, Boehm, Grünwald, P. D., Ramdas, A., & van Ravenzwaaij, D. (2024). Safe Anytime-Valid Inference: Practical maximally flexible sampling designs for experiments based on e-values. PsyArXiv Preprint, https://doi.org/10.31234/osf.io/h5vae.

Examples

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


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