SBFNAP_onez {NAP}R Documentation

Sequential Bayes Factor using the NAP for one-sample zz-tests

Description

In a N(μ,σ02)N(\mu,\sigma_0^2) population with known variance σ02\sigma_0^2, consider the two-sided one-sample zz-test for testing the point null hypothesis H0:μ=0H_0 : \mu = 0 against H1:μ0H_1 : \mu \neq 0. This function calculates the operating characteristics (OC) and average sample number (ASN) of the Sequential Bayes Factor design when a normal moment prior is assumed on the standardized effect size μ/σ0\mu/\sigma_0 under the alternative.

Usage

SBFNAP_onez(es = c(0, 0.2, 0.3, 0.5), nmin = 1, nmax = 5000, 
            tau.NAP = 0.3/sqrt(2), sigma0 = 1, 
            RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), 
            batch.size.increment, nReplicate = 50000, nCore)

Arguments

es

Numeric vector. Standardized effect sizes μ/σ0\mu/\sigma_0 where OC and ASN are desired. Default: c(0, 0.2, 0.3, 0.5).

nmin

Positive integer. Minimum sample size in the sequential comparison. Default: 1.

nmax

Positive integer. Maximum sample size in the sequential comparison. Default: 1.

tau.NAP

Positive numeric. Parameter in the moment prior. Default: 0.3/20.3/\sqrt2. This places the prior modes of the standardized effect size μ/σ0\mu/\sigma_0 at 0.30.3 and 0.3-0.3.

sigma0

Positive numeric. Known standard deviation in the population. Default: 1.

RejectH1.threshold

Positive numeric. H0H_0 is accepted if BFBF \leRejectH1.threshold. Default: exp(-3).

RejectH0.threshold

Positive numeric. H0H_0 is rejected if BFBF \geRejectH0.threshold. Default: exp(3).

batch.size.increment

function. Increment in sample size at each sequential step. 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 OC and ASN are calculated. Default: 50,000.

nCore

Positive integer. Default: One less than the total number of available cores.

Value

A list with three components named summary, BF, and N.

$summary is a data frame with columns effect.size containing the values in es. At those values, acceptH0 contains the proportion of times H_0 is accepted, rejectH0 contains the proportion of times H_0 is rejected, inconclusive contains the proportion of times the test is inconclusive, ASN contains the ASN, and avg.logBF contains the expected weight of evidence values.

$BF is a matrix of dimension length(es) by nReplicate. Each row contains the Bayes factor values at the corresponding standardized effec size in nReplicate replicated studies.

$N is a matrix of the same dimension as $BF. Each row contains the sample size required to reach a decision at the corresponding standardized effec size in nReplicate replicated studies.

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


out = SBFNAP_onez(nmax = 100, es = c(0, 0.3), nCore = 1)


[Package NAP version 1.1 Index]