implement.SBFHajnal_twoz: Implement Sequential Bayes Factor using the NAP for...

Description Usage Arguments Value Author(s) References Examples

View source: R/NAPfunctions.R

Description

In case of two independent populations N(μ_1,σ_0^2) and N(μ_2,σ_0^2) with known common variance σ_0^2, consider the two-sample z-test for testing the point null hypothesis of difference in their means H_0 : μ_2 - μ_1 = 0 against H_1 : μ_2 - μ_1 \neq 0. For a sequentially observed data, this function implements the Sequential Bayes Factor design when a normal moment prior is assumed on the difference between standardized effect sizes (μ_2 - μ_1)/σ_0 under the alternative.

Usage

1
2
3
4
implement.SBFHajnal_twoz(obs1, obs2, es1 = 0.3, sigma0 = 1,
                         RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), 
                         batch1.size, batch2.size, return.plot = TRUE, 
                         until.decision.reached = TRUE)

Arguments

obs1

Numeric vector. The vector of sequentially observed data from Group-1.

obs2

Numeric vector. The vector of sequentially observed data from Group-2.

es1

Positive numeric. δ as above. Default: 0.3. For this, the prior on (μ_2 - μ_1)/σ_0 takes values 0.3 and -0.3 each with equal probability 1/2.

sigma0

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

RejectH1.threshold

Positive numeric. H_0 is accepted if BF ≤RejectH1.threshold. Default: exp(-3).

RejectH0.threshold

Positive numeric. H_0 is rejected if BF ≥RejectH0.threshold. Default: exp(3).

batch1.size

Integer vector. The vector of batch sizes from Group-1 at each sequential comparison. Default: rep(1, length(obs1)).

batch2.size

Integer vector. The vector of batch sizes from Group-2 at each sequential comparison. Default: rep(1, length(obs2)).

return.plot

Logical. Whether a sequential comparison plot to be returned. Default: TRUE.

until.decision.reached

Logical. Whether the sequential comparison is performed until a decision is reached or until the data is observed. Default: TRUE. This means the comparison is performed until a decision is reached.

Value

A list with three components named N1, N2, BF, and decision.

$N1 and $N2 contains the number of sample size used from Group-1 and 2.

$BF contains the Bayes factor values at each sequential comparison.

$decision contains the decision reached. 'A' indicates acceptance of H_0, 'R' indicates rejection of H_0, and 'I' indicates inconclusive.

Author(s)

Sandipan Pramanik and Valen E. Johnson

References

Hajnal, J. (1961). A two-sample sequential t-test.Biometrika, 48:65-75, [Article].

Schnuerch, M. and Erdfelder, E. (2020). A two-sample sequential t-test.Biometrika, 48:65-75, [Article].

Examples

1
out = implement.SBFHajnal_twoz(obs1 = rnorm(100), obs2 = rnorm(100))

NAP documentation built on Jan. 6, 2022, 5:07 p.m.