Learn R Programming

NAP (version 1.1)

fixedNAP.onet_es: Fixed-design one-sample \(t\)-tests with NAP for varied sample sizes

Description

In two-sided fixed design one-sample \(t\)-tests with normal moment prior assumed on the standardized effect size \(\mu/\sigma\) under the alternative, this function calculates the expected weights of evidence (that is, expected log(Bayes Factor)) of the test at a prefixed standardized effect size for a varied range of sample sizes.

Usage

fixedNAP.onet_es(es = 0, nmin = 20, nmax = 5000, 
                 tau.NAP = 0.3/sqrt(2),
                 batch.size.increment, nReplicate = 50000)

Arguments

es

Numeric. Standardized effect size where the expected weights of evidence is desired. Default: 0.

nmin

Positive integer. Minimum sample size to be considered. Default: 20.

nmax

Positive integer. Maximum sample size to be considered. Default: 5000.

tau.NAP

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\).

batch.size.increment

Positive numeric. Increment in sample size. The sequence of sample size thus considered for the fixed design test is from nmin to nmax with an increment of batch.size.increment. Default: function(narg){20}. This means an increment of 20 samples at each step.

nReplicate

Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000.

Value

A list with two components named summary and BF.

$summary is a data frame with columns n containing the values of sample sizes 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.

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

Run this code
# NOT RUN {
out = fixedNAP.onet_es(nmax = 100)
# }

Run the code above in your browser using DataLab