computeConjugateCredibleIntervalTwoSampleT: Computes the credible interval of a two-sample t-test based...

View source: R/tTest.R

computeConjugateCredibleIntervalTwoSampleTR Documentation

Computes the credible interval of a two-sample t-test based on conjugate priors

Description

Computes the credible interval of a two-sample t-test based on conjugate priors

Usage

computeConjugateCredibleIntervalTwoSampleT(
  x1,
  sdObs1,
  n1,
  x2,
  sdObs2,
  n2,
  a1 = 3.98,
  g1 = 0.03,
  a2 = 4.02,
  g2 = 0.05,
  aGamma = 2,
  bGamma = 1/2,
  ciValue = 0.95
)

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

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

ciValue

numeric representing the confidence level. Default ciValue=NULL yields ciValue = 1 - alpha

Value

a vector of length two representing the credible interval

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

computeConjugateCredibleIntervalTwoSampleT(1, 1, 3, 1, 1, 3)

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