In two-sided fixed design two-sample \(z\)-tests with normal moment prior assumed on the difference between standardized effect sizes \((\mu_2 - \mu_1)/\sigma_0\) under the alternative, this function calculates the expected weights of evidence (that is, expected log(Bayes Factor)) of the test at a prefixed differences between standardized effect size for a varied range of sample sizes.
fixedNAP.twoz_es(es = 0, n1min = 20, n2min = 20,
n1max = 5000, n2max = 5000,
tau.NAP = 0.3/sqrt(2), sigma0 = 1,
batch1.size.increment, batch2.size.increment,
nReplicate = 50000)
Numeric. Difference between standardized effect sizes where the expected weights of evidence is desired. Default: 0
.
Positive integer. Minimum sample size from Grpup-1 to be considered. Default: 20.
Positive integer. Minimum sample size from Grpup-2 to be considered. Default: 20.
Positive integer. Maximum sample size from Grpup-1 to be considered. Default: 5000.
Positive integer. Maximum sample size from Grpup-2 to be considered. Default: 5000.
Positive numeric. Parameter in the moment prior. Default: \(0.3/\sqrt2\). This places the prior modes of \((\mu_2 - \mu_1)/\sigma_0\) at \(0.3\) and \(-0.3\).
Positive numeric. Known common standard deviation of the populations. Default: 1.
Positive numeric. Increment in sample size from Group-1. The sequence of sample size thus considered from Group-1 for the fixed design test is from n1min
to n1max
with an increment of batch1.size.increment
. Default: function(narg){20}
. This means an increment of 20 samples from Group-1 at each step.
Positive numeric. Increment in sample size from Group-2. The sequence of sample size thus considered from Group-2 for the fixed design test is from n2min
to n2max
with an increment of batch2.size.increment
. Default: function(narg){20}
. This means an increment of 20 samples from Group-2 at each step.
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000.
A list with two components named summary
and BF
.
$summary
is a data frame with columns n1
containing the sample sizes from Group-1, n2
containing the sample sizes from Group-2, and avg.logBF
containing the expected weight of evidence values at those values.
$BF
is a matrix of dimension number of sample sizes considered
by nReplicate
. Each row contains the Bayes factor values at the corresponding sample size in nReplicate
replicated studies.
n1min
, n1max
, batch1.size.increment
, and n2min
, n2max
, batch2.size.increment
should be chosen such that the length of sample sizes considered from Group 1 and 2 are equal.
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 {
out = fixedNAP.twoz_es(n1max = 100, n2max = 100)
# }
Run the code above in your browser using DataLab