NAPBF_onet: Bayes factor in favor of the NAP in one-sample t tests

Description Usage Arguments Details Value Author(s) References Examples

View source: R/NAPfunctions.R

Description

In a N(μ,σ^2) population with unknown variance σ^2, consider the two-sided one-sample t-test for testing the point null hypothesis H_0 : μ = 0 against H_1 : μ \neq 0. Based on an observed data, this function calculates the Bayes factor in favor of H_1 when a normal moment prior is assumed on the standardized effect size μ/σ under the alternative. Under both hypotheses, the Jeffrey's prior π(σ^2) \propto 1/σ^2 is assumed on σ^2.

Usage

1
2
NAPBF_onet(obs, nObs, mean.obs, sd.obs, 
           test.statistic, tau.NAP = 0.3/sqrt(2))

Arguments

obs

Numeric vector. Observed vector of data.

nObs

Numeric or numeric vector. Sample size(s). Same as length(obs) when numeric.

mean.obs

Numeric or numeric vector. Sample mean(s). Same as mean(obs) when numeric.

sd.obs

Positive numeric or numeric vector. Sample standard deviation(s). Same as sd(obs) when numeric.

test.statistic

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

tau.NAP

Positive numeric. Parameter in the moment prior. Default: 0.3/√2. This places the prior modes of the standardized effect size μ/σ at 0.3 and -0.3.

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

1
NAPBF_onet(obs = rnorm(100))

NAP documentation built on Jan. 6, 2022, 5:07 p.m.