NAPBF_onet {NAP} | R Documentation |
Bayes factor in favor of the NAP in one-sample
tests
Description
In a population with unknown variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. Based on an observed data, this function calculates the Bayes factor in favor of
when a normal moment prior is assumed on the standardized effect size
under the alternative. Under both hypotheses, the Jeffrey's prior
is assumed on
.
Usage
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 |
mean.obs |
Numeric or numeric vector. Sample mean(s). Same as |
sd.obs |
Positive numeric or numeric vector. Sample standard deviation(s). Same as |
test.statistic |
Numeric or numeric vector. Test-statistic value(s). |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
Details
Users can either specify
obs
, ornObs
,mean.obs
andsd.obs
, ornObs
andtest.statistic
.If
obs
is provided, it returns the corresponding Bayes factor value.If
nObs
,mean.obs
andsd.obs
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.If
nObs
andtest.statistic
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
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_onet(obs = rnorm(100))