NAPBF_twoz {NAP}R Documentation

Bayes factor in favor of the NAP in two-sample zz tests

Description

In case of two independent populations N(μ1,σ02)N(\mu_1,\sigma_0^2) and N(μ2,σ02)N(\mu_2,\sigma_0^2) with known common variance σ02\sigma_0^2, consider the two-sample zz-test for testing the point null hypothesis of difference in their means H0:μ2μ1=0H_0 : \mu_2 - \mu_1 = 0 against H1:μ2μ10H_1 : \mu_2 - \mu_1 \neq 0. Based on an observed data, this function calculates the Bayes factor in favor of H1H_1 when a normal moment prior is assumed on the difference between standardized effect sizes (μ2μ1)/σ0(\mu_2 - \mu_1)/\sigma_0 under the alternative.

Usage

NAPBF_twoz(obs1, obs2, n1Obs, n2Obs, 
           mean.obs1, mean.obs2, test.statistic, 
           tau.NAP = 0.3/sqrt(2), sigma0 = 1)

Arguments

obs1

Numeric vector. Observed vector of data from Group-1.

obs2

Numeric vector. Observed vector of data from Group-2.

n1Obs

Numeric or numeric vector. Sample size(s) from Group-1. Same as length(obs1) when numeric.

n2Obs

Numeric or numeric vector. Sample size(s) from Group-2. Same as length(obs2) when numeric.

mean.obs1

Numeric or numeric vector. Sample mean(s) from Group-1. Same as mean(obs1) when numeric.

mean.obs2

Numeric or numeric vector. Sample mean(s) from Group-2. Same as mean(obs2) when numeric.

test.statistic

Numeric or numeric vector. Test-statistic value(s).

tau.NAP

Positive numeric. Parameter in the moment prior. Default: 0.3/20.3/\sqrt{2}. This places the prior modes of (μ2μ1)/σ0(\mu_2 - \mu_1)/\sigma_0 at 0.30.3 and 0.3-0.3.

sigma0

Positive numeric. Known common standard deviation of the populations. Default: 1.

Details

Value

Positive numeric or numeric vector. The Bayes factor value(s).

Author(s)

Sandipan Pramanik and Valen E. Johnson

References

Pramanik, S. and Johnson, V. (2022). Efficient Alternatives for Bayesian Hypothesis Tests in Psychology. Psychological Methods. Just accepted.

Johnson, V. and Rossell, R. (2010). On the use of non-local prior densities in Bayesian hypothesis tests. Journal of the Royal Statistical Society: Series B, 72:143-170. [Article]

Examples

NAPBF_twoz(obs1 = rnorm(100), obs2 = rnorm(100))

[Package NAP version 1.1 Index]