Description Usage Arguments Details Value Author(s) References Examples
In a N(μ,σ_0^2) population with known variance σ_0^2, consider the two-sided one-sample z-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 μ/σ_0 under the alternative.
1 2 | NAPBF_onez(obs, nObs, mean.obs, test.statistic,
tau.NAP = 0.3/sqrt(2), sigma0 = 1)
|
obs |
Numeric vector. Observed vector of data. |
nObs |
Numeric or numeric vector. Sample size(s). Same as |
mean.obs |
Numeric or numeric vector. Sample mean(s). Same as |
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 μ/σ_0 at 0.3 and -0.3. |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
Users can either specify obs
, or nObs
and mean.obs
, or nObs
and test.statistic
.
If obs
is provided, it returns the corresponding Bayes factor value.
If nObs
and mean.obs
are provided, the function is vectorized over both arguments. Bayes factor values corresponding to the values therein are returned.
If nObs
and test.statistic
are provided, the function is vectorized over both arguments. Bayes factor values corresponding to the values therein are returned.
Positive numeric or numeric vector. The Bayes factor value(s).
Sandipan Pramanik and Valen E. Johnson
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]
1 | NAPBF_onez(obs = rnorm(100))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.