In a \(N(\mu,\sigma^2)\) population with unknown variance \(\sigma^2\), consider the two-sided one-sample \(t\)-test for testing the point null hypothesis \(H_0 : \mu = 0\) against \(H_1 : \mu \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 \(\mu/\sigma\) under the alternative. Under both hypotheses, the Jeffrey's prior \(\pi(\sigma^2) \propto 1/\sigma^2\) is assumed on \(\sigma^2\).
NAPBF_onet(obs, nObs, mean.obs, sd.obs,
test.statistic, tau.NAP = 0.3/sqrt(2))
Numeric vector. Observed vector of data.
Numeric or numeric vector. Sample size(s). Same as length(obs)
when numeric.
Numeric or numeric vector. Sample mean(s). Same as mean(obs)
when numeric.
Positive numeric or numeric vector. Sample standard deviation(s). Same as sd(obs)
when numeric.
Numeric or numeric vector. Test-statistic value(s).
Positive numeric. Parameter in the moment prior. Default: \(0.3/\sqrt2\). This places the prior modes of the standardized effect size \(\mu/\sigma\) at \(0.3\) and \(-0.3\).
Positive numeric or numeric vector. The Bayes factor value(s).
Users can either specify obs
, or nObs
, mean.obs
and sd.obs
, or nObs
and test.statistic
.
If obs
is provided, it returns the corresponding Bayes factor value.
If nObs
, mean.obs
and sd.obs
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
If nObs
and test.statistic
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
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]
# NOT RUN {
NAPBF_onet(obs = rnorm(100))
# }
Run the code above in your browser using DataLab