In case of two independent populations \(N(\mu_1,\sigma^2)\) and \(N(\mu_2,\sigma^2)\) with unknown common variance \(\sigma^2\), consider the two-sample \(t\)-test for testing the point null hypothesis of difference in their means \(H_0 : \mu_2 - \mu_1 = 0\) against \(H_1 : \mu_2 - \mu_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 \((\mu_2 - \mu_1)/\sigma\) under the alternative.
implement.SBFNAP_twot(obs1, obs2, tau.NAP = 0.3/sqrt(2),
RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3),
batch1.size, batch2.size, return.plot = TRUE,
until.decision.reached = TRUE)
Numeric vector. The vector of sequentially observed data from Group-1.
Numeric vector. The vector of sequentially observed data from Group-2.
Positive numeric. Parameter in the moment prior. Default: \(0.3/\sqrt2\). This places the prior modes of the difference between standardized effect sizes \((\mu_2 - \mu_1)/\sigma\) at \(0.3\) and \(-0.3\).
Positive numeric. \(H_0\) is accepted if \(BF \le\)RejectH1.threshold
. Default: exp(-3)
.
Positive numeric. \(H_0\) is rejected if \(BF \ge\)RejectH0.threshold
. Default: exp(3)
.
Integer vector. The vector of batch sizes from Group-1 at each sequential comparison. The first element (the first batch size) needs to be at least 2. Default: c(2, rep(1, length(obs1)-2))
.
Integer vector. The vector of batch sizes from Group-2 at each sequential comparison. The first element (the first batch size) needs to be at least 2. Default: c(2, rep(1, length(obs2)-2))
.
Logical. Whether a sequential comparison plot to be returned. Default: TRUE
.
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.
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.
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 = implement.SBFNAP_twot(obs1 = rnorm(100), obs2 = rnorm(100))
# }
Run the code above in your browser using DataLab