Title: | Non-Local Alternative Priors in Psychology |
---|---|
Description: | Conducts Bayesian Hypothesis tests of a point null hypothesis against a two-sided alternative using Non-local Alternative Prior (NAP) for one- and two-sample z- and t-tests (Pramanik and Johnson, 2022). Under the alternative, the NAP is assumed on the standardized effects size in one-sample tests and on their differences in two-sample tests. The package considers two types of NAP densities: (1) the normal moment prior, and (2) the composite alternative. In fixed design tests, the functions calculate the Bayes factors and the expected weight of evidence for varied effect size and sample size. The package also provides a sequential testing framework using the Sequential Bayes Factor (SBF) design. The functions calculate the operating characteristics (OC) and the average sample number (ASN), and also conducts sequential tests for a sequentially observed data. |
Authors: | Sandipan Pramanik [aut, cre], Valen E. Johnson [aut] |
Maintainer: | Sandipan Pramanik <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.1 |
Built: | 2024-11-26 06:26:02 UTC |
Source: | CRAN |
Conducts Bayesian Hypothesis tests of a point null hypothesis against a two-sided alternative using Non-local Alternative Prior (NAP) for one- and two-sample z- and t-tests (Pramanik and Johnson, 2022). Under the alternative, the NAP is assumed on the standardized effects size in one-sample tests and on their differences in two-sample tests. The package considers two types of NAP densities: (1) the normal moment prior, and (2) the composite alternative. In fixed design tests, the functions calculate the Bayes factors and the expected weight of evidence for varied effect size and sample size. The package also provides a sequential testing framework using the Sequential Bayes Factor (SBF) design. The functions calculate the operating characteristics (OC) and the average sample number (ASN), and also conducts sequential tests for a sequentially observed data.
Package: | NAP |
Type: | Package |
Version: | 1.1 |
Date: | 2022-1-6 |
License: GPL (>= 2) |
Sandipan Pramanik [aut, cre], Valen E. Johnson [aut]
Maintainer: Sandipan Pramanik <[email protected]>
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]
-tests using Hajnal's ratio for varied sample sizes
In two-sided fixed design one-sample -tests with composite alternative prior assumed on the standardized effect size
under the alternative, this function calculates the expected log(Hajnal's ratio) at a prefixed standardized effect size for a varied range of sample sizes.
fixedHajnal.onet_es(es = 0, es1 = 0.3, nmin = 20, nmax = 5000, batch.size.increment, nReplicate = 50000)
fixedHajnal.onet_es(es = 0, es1 = 0.3, nmin = 20, nmax = 5000, batch.size.increment, nReplicate = 50000)
es |
Numeric. Standardized effect size where the expected weights of evidence is desired. Default: |
es1 |
Positive numeric. Default: |
nmin |
Positive integer. Minimum sample size to be considered. Default: 20. |
nmax |
Positive integer. Maximum sample size to be considered. Default: 5000. |
batch.size.increment |
Positive numeric. Increment in sample size. The sequence of sample size thus considered for the fixed design test is from |
nReplicate |
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 n
containing the values of sample sizes and avg.logBF
containing the expected log(Hajnal's ratios) at those values.
$BF
is a matrix of dimension number of sample sizes considered
by nReplicate
. Each row contains the Hajnal's ratios at the corresponding sample size in nReplicate
replicated studies.
Sandipan Pramanik and Valen E. Johnson
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].
out = fixedHajnal.onet_es(nmax = 100)
out = fixedHajnal.onet_es(nmax = 100)
-tests using Hajnal's ratio and a pre-fixed sample size
In two-sided fixed design one-sample -tests with composite alternative prior assumed on the standardized effect size
under the alternative and a prefixed sample size, this function calculates the expected log(Hajnal's ratio) at a varied range of standardized effect sizes.
fixedHajnal.onet_n(es1 = 0.3, es = c(0, 0.2, 0.3, 0.5), n.fixed = 20, nReplicate = 50000, nCore)
fixedHajnal.onet_n(es1 = 0.3, es = c(0, 0.2, 0.3, 0.5), n.fixed = 20, nReplicate = 50000, nCore)
es1 |
Positive numeric. Default: |
es |
Numeric vector. Standardized effect sizes |
n.fixed |
Positive integer. Prefixed sample size. Default: 20. |
nReplicate |
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000. |
nCore |
Positive integer. Default: One less than the total number of available cores. |
A list with two components named summary
and BF
.
$summary
is a data frame with columns effect.size
containing the values in es
and avg.logBF
containing the expected log(Hajnal's ratios) at those values.
$BF
is a matrix of dimension length(es)
by nReplicate
. Each row contains the Hajnal's ratios at the corresponding standardized effec size in nReplicate
replicated studies.
Sandipan Pramanik and Valen E. Johnson
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].
out = fixedHajnal.onet_n(n.fixed = 20, es = c(0, 0.3), nCore = 1)
out = fixedHajnal.onet_n(n.fixed = 20, es = c(0, 0.3), nCore = 1)
-tests using Hajnal's ratio for varied sample sizes
In two-sided fixed design one-sample -tests with composite alternative prior assumed on the standardized effect size
under the alternative, this function calculates the expected log(Hajnal's ratio) at a prefixed standardized effect size for a varied range of sample sizes.
fixedHajnal.onez_es(es = 0, es1 = 0.3, nmin = 20, nmax = 5000, sigma0 = 1, batch.size.increment, nReplicate = 50000)
fixedHajnal.onez_es(es = 0, es1 = 0.3, nmin = 20, nmax = 5000, sigma0 = 1, batch.size.increment, nReplicate = 50000)
es |
Numeric. Standardized effect size where the expected weights of evidence is desired. Default: |
es1 |
Positive numeric. Default: |
nmin |
Positive integer. Minimum sample size to be considered. Default: 20. |
nmax |
Positive integer. Maximum sample size to be considered. Default: 5000. |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
batch.size.increment |
function. Increment in sample size. The sequence of sample size thus considered for the fixed design test is from |
nReplicate |
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 n
containing the values of sample sizes and avg.logBF
containing the expected log(Hajnal's ratios) at those values.
$BF
is a matrix of dimension number of sample sizes considered
by nReplicate
. Each row contains the Hajnal's ratios at the corresponding sample size in nReplicate
replicated studies.
Sandipan Pramanik and Valen E. Johnson
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].
out = fixedHajnal.onez_es(nmax = 100)
out = fixedHajnal.onez_es(nmax = 100)
-tests using Hajnal's ratio and a pre-fixed sample size
In two-sided fixed design one-sample -tests with composite alternative prior assumed on the standardized effect size
under the alternative and a prefixed sample size, this function calculates the expected log(Hajnal's ratio) at a varied range of standardized effect sizes.
fixedHajnal.onez_n(es1 = 0.3, es = c(0, 0.2, 0.3, 0.5), n.fixed = 20, sigma0 = 1, nReplicate = 50000, nCore)
fixedHajnal.onez_n(es1 = 0.3, es = c(0, 0.2, 0.3, 0.5), n.fixed = 20, sigma0 = 1, nReplicate = 50000, nCore)
es1 |
Positive numeric. Default: |
es |
Numeric vector. Standardized effect sizes |
n.fixed |
Positive integer. Prefixed sample size. Default: 20. |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
nReplicate |
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000. |
nCore |
Positive integer. Default: One less than the total number of available cores. |
A list with two components named summary
and BF
.
$summary
is a data frame with columns effect.size
containing the values in es
and avg.logBF
containing the expected log(Hajnal's ratios) at those values.
$BF
is a matrix of dimension length(es)
by nReplicate
. Each row contains the Hajnal's ratios at the corresponding standardized effec size in nReplicate
replicated studies.
Sandipan Pramanik and Valen E. Johnson
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].
out = fixedHajnal.onez_n(n.fixed = 20, es = c(0, 0.3), nCore = 1)
out = fixedHajnal.onez_n(n.fixed = 20, es = c(0, 0.3), nCore = 1)
-tests with NAP for varied sample sizes
In two-sided fixed design two-sample -tests with composite alternative prior assumed on the difference between standardized effect sizes
under the alternative, this function calculates the expected log(Hajnal's ratio) at a prefixed standardized effect size for a varied range of sample sizes.
fixedHajnal.twot_es(es = 0, es1 = 0.3, n1min = 20, n2min = 20, n1max = 5000, n2max = 5000, batch1.size.increment, batch2.size.increment, nReplicate = 50000)
fixedHajnal.twot_es(es = 0, es1 = 0.3, n1min = 20, n2min = 20, n1max = 5000, n2max = 5000, batch1.size.increment, batch2.size.increment, nReplicate = 50000)
es |
Numeric. Difference between standardized effect sizes where the expected weights of evidence is desired. Default: |
es1 |
Positive numeric. |
n1min |
Positive integer. Minimum sample size from Grpup-1 to be considered. Default: 20. |
n2min |
Positive integer. Minimum sample size from Grpup-2 to be considered. Default: 20. |
n1max |
Positive integer. Maximum sample size from Grpup-1 to be considered. Default: 5000. |
n2max |
Positive integer. Maximum sample size from Grpup-2 to be considered. Default: 5000. |
batch1.size.increment |
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 |
batch2.size.increment |
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 |
nReplicate |
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 n
containing the values of sample sizes and avg.logBF
containing the expected log(Hajnal's ratios) at those values.
$BF
is a matrix of dimension number of sample sizes considered
by nReplicate
. Each row contains the Hajnal's ratios at the corresponding sample size in nReplicate
replicated studies.
Sandipan Pramanik and Valen E. Johnson
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].
out = fixedHajnal.twot_es(n1max = 100, n2max = 100)
out = fixedHajnal.twot_es(n1max = 100, n2max = 100)
-tests using Hajnal's ratio and a pre-fixed sample size
In two-sided fixed design two-sample -tests with composite alternative prior assumed on the standardized effect size
under the alternative and a prefixed sample size, this function calculates the expected log(Hajnal's ratio) at a varied range of differences between standardized effect sizes.
fixedHajnal.twot_n(es1 = 0.3, es = c(0, 0.2, 0.3, 0.5), n1.fixed = 20, n2.fixed = 20, nReplicate = 50000, nCore)
fixedHajnal.twot_n(es1 = 0.3, es = c(0, 0.2, 0.3, 0.5), n1.fixed = 20, n2.fixed = 20, nReplicate = 50000, nCore)
es1 |
Positive numeric. |
es |
Numeric vector. Standardized effect size differences |
n1.fixed |
Positive integer. Prefixed sample size from Group-1. Default: 20. |
n2.fixed |
Positive integer. Prefixed sample size from Group-2. Default: 20. |
nReplicate |
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000. |
nCore |
Positive integer. Default: One less than the total number of available cores. |
A list with two components named summary
and BF
.
$summary
is a data frame with columns effect.size
containing the values in es
and avg.logBF
containing the expected log(Hajnal's ratios) at those values.
$BF
is a matrix of dimension length(es)
by nReplicate
. Each row contains the Hajnal's ratios at the corresponding standardized effec size in nReplicate
replicated studies.
Sandipan Pramanik and Valen E. Johnson
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].
out = fixedHajnal.twot_n(n1.fixed = 20, n2.fixed = 20, es = c(0, 0.3), nCore = 1)
out = fixedHajnal.twot_n(n1.fixed = 20, n2.fixed = 20, es = c(0, 0.3), nCore = 1)
-tests with NAP for varied sample sizes
In two-sided fixed design two-sample -tests with composite alternative prior assumed on the difference between standardized effect sizes
under the alternative, this function calculates the expected log(Hajnal's ratio) at a prefixed standardized effect size for a varied range of sample sizes.
fixedHajnal.twoz_es(es = 0, es1 = 0.3, n1min = 20, n2min = 20, n1max = 5000, n2max = 5000, sigma0 = 1, batch1.size.increment, batch2.size.increment, nReplicate = 50000)
fixedHajnal.twoz_es(es = 0, es1 = 0.3, n1min = 20, n2min = 20, n1max = 5000, n2max = 5000, sigma0 = 1, batch1.size.increment, batch2.size.increment, nReplicate = 50000)
es |
Numeric. Difference between standardized effect sizes where the expected weights of evidence is desired. Default: |
es1 |
Positive numeric. |
n1min |
Positive integer. Minimum sample size from Grpup-1 to be considered. Default: 20. |
n2min |
Positive integer. Minimum sample size from Grpup-2 to be considered. Default: 20. |
n1max |
Positive integer. Maximum sample size from Grpup-1 to be considered. Default: 5000. |
n2max |
Positive integer. Maximum sample size from Grpup-2 to be considered. Default: 5000. |
sigma0 |
Positive numeric. Known common standard deviation of the populations. Default: 1. |
batch1.size.increment |
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 |
batch2.size.increment |
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 |
nReplicate |
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 n
containing the values of sample sizes and avg.logBF
containing the expected log(Hajnal's ratios) at those values.
$BF
is a matrix of dimension number of sample sizes considered
by nReplicate
. Each row contains the Hajnal's ratios at the corresponding sample size in nReplicate
replicated studies.
Sandipan Pramanik and Valen E. Johnson
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].
out = fixedHajnal.twoz_es(n1max = 100, n2max = 100)
out = fixedHajnal.twoz_es(n1max = 100, n2max = 100)
-tests using Hajnal's ratio and a pre-fixed sample size
In two-sided fixed design two-sample -tests with composite alternative prior assumed on the standardized effect size
under the alternative and a prefixed sample size, this function calculates the expected log(Hajnal's ratio) at a varied range of differences between standardized effect sizes.
fixedHajnal.twoz_n(es1 = 0.3, es = c(0, 0.2, 0.3, 0.5), n1.fixed = 20, n2.fixed = 20, sigma0 = 1, nReplicate = 50000, nCore)
fixedHajnal.twoz_n(es1 = 0.3, es = c(0, 0.2, 0.3, 0.5), n1.fixed = 20, n2.fixed = 20, sigma0 = 1, nReplicate = 50000, nCore)
es1 |
Positive numeric. Default: |
es |
Numeric vector. Standardized effect size differences |
n1.fixed |
Positive integer. Prefixed sample size from Group-1. Default: 20. |
n2.fixed |
Positive integer. Prefixed sample size from Group-2. Default: 20. |
sigma0 |
Positive numeric. Known common standard deviation of the populations. Default: 1. |
nReplicate |
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000. |
nCore |
Positive integer. Default: One less than the total number of available cores. |
A list with two components named summary
and BF
.
$summary
is a data frame with columns effect.size
containing the values in es
and avg.logBF
containing the expected log(Hajnal's ratios) at those values.
$BF
is a matrix of dimension length(es)
by nReplicate
. Each row contains the Hajnal's ratios at the corresponding standardized effec size in nReplicate
replicated studies.
Sandipan Pramanik and Valen E. Johnson
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].
out = fixedHajnal.twoz_n(n1.fixed = 20, n2.fixed = 20, es = c(0, 0.3), nCore = 1)
out = fixedHajnal.twoz_n(n1.fixed = 20, n2.fixed = 20, es = c(0, 0.3), nCore = 1)
-tests with NAP for varied sample sizes
In two-sided fixed design one-sample -tests with normal moment prior assumed on the standardized effect size
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.
fixedNAP.onet_es(es = 0, nmin = 20, nmax = 5000, tau.NAP = 0.3/sqrt(2), batch.size.increment, nReplicate = 50000)
fixedNAP.onet_es(es = 0, nmin = 20, nmax = 5000, tau.NAP = 0.3/sqrt(2), batch.size.increment, nReplicate = 50000)
es |
Numeric. Standardized effect size where the expected weights of evidence is desired. Default: |
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: |
batch.size.increment |
Positive numeric. Increment in sample size. The sequence of sample size thus considered for the fixed design test is from |
nReplicate |
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 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.
Sandipan Pramanik and Valen E. Johnson
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]
out = fixedNAP.onet_es(nmax = 100)
out = fixedNAP.onet_es(nmax = 100)
-tests with NAP and a pre-fixed sample size
In two-sided fixed design one-sample -tests with normal moment prior assumed on the standardized effect size
under the alternative and a prefixed sample size, this function calculates the expected weights of evidence (that is, expected log(Bayes Factor)) of the test at a varied range of standardized effect sizes.
fixedNAP.onet_n(es = c(0, 0.2, 0.3, 0.5), n.fixed = 20, tau.NAP = 0.3/sqrt(2), nReplicate = 50000, nCore)
fixedNAP.onet_n(es = c(0, 0.2, 0.3, 0.5), n.fixed = 20, tau.NAP = 0.3/sqrt(2), nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect sizes |
n.fixed |
Positive integer. Prefixed sample size. Default: 20. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
nReplicate |
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000. |
nCore |
Positive integer. Default: One less than the total number of available cores. |
A list with two components named summary
and BF
.
$summary
is a data frame with columns effect.size
containing the values in es
and avg.logBF
containing the expected weight of evidence values at those 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.
Sandipan Pramanik and Valen E. Johnson
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]
out = fixedNAP.onet_n(n.fixed = 20, es = c(0, 0.3), nCore = 1)
out = fixedNAP.onet_n(n.fixed = 20, es = c(0, 0.3), nCore = 1)
-tests with NAP for varied sample sizes
In two-sided fixed design one-sample -tests with normal moment prior assumed on the standardized effect size
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.
fixedNAP.onez_es(es = 0, nmin = 20, nmax = 5000, tau.NAP = 0.3/sqrt(2), sigma0 = 1, batch.size.increment, nReplicate = 50000)
fixedNAP.onez_es(es = 0, nmin = 20, nmax = 5000, tau.NAP = 0.3/sqrt(2), sigma0 = 1, batch.size.increment, nReplicate = 50000)
es |
Numeric. Standardized effect size where the expected weights of evidence is desired. Default: |
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: |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
batch.size.increment |
function. Increment in sample size. The sequence of sample size thus considered for the fixed design test is from |
nReplicate |
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 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.
Sandipan Pramanik and Valen E. Johnson
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]
out = fixedNAP.onez_es(nmax = 100)
out = fixedNAP.onez_es(nmax = 100)
-tests with NAP and a pre-fixed sample size
In two-sided fixed design one-sample -tests with normal moment prior assumed on the standardized effect size
under the alternative and a prefixed sample size, this function calculates the expected weights of evidence (that is, expected log(Bayes Factor)) of the test at a varied range of standardized effect sizes.
fixedNAP.onez_n(es = c(0, 0.2, 0.3, 0.5), n.fixed = 20, tau.NAP = 0.3/sqrt(2), sigma0 = 1, nReplicate = 50000, nCore)
fixedNAP.onez_n(es = c(0, 0.2, 0.3, 0.5), n.fixed = 20, tau.NAP = 0.3/sqrt(2), sigma0 = 1, nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect sizes |
n.fixed |
Positive integer. Prefixed sample size. Default: 20. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
nReplicate |
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000. |
nCore |
Positive integer. Default: One less than the total number of available cores. |
A list with two components named summary
and BF
.
$summary
is a data frame with columns effect.size
containing the values in es
and avg.logBF
containing the expected weight of evidence values at those 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.
Sandipan Pramanik and Valen E. Johnson
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]
out = fixedNAP.onez_n(n.fixed = 20, es = c(0, 0.3), nCore = 1)
out = fixedNAP.onez_n(n.fixed = 20, es = c(0, 0.3), nCore = 1)
-tests with NAP for varied sample sizes
In two-sided fixed design two-sample -tests with normal moment prior assumed on the difference between standardized effect sizes
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.twot_es(es = 0, n1min = 20, n2min = 20, n1max = 5000, n2max = 5000, tau.NAP = 0.3/sqrt(2), batch1.size.increment, batch2.size.increment, nReplicate = 50000)
fixedNAP.twot_es(es = 0, n1min = 20, n2min = 20, n1max = 5000, n2max = 5000, tau.NAP = 0.3/sqrt(2), batch1.size.increment, batch2.size.increment, nReplicate = 50000)
es |
Numeric. Difference between standardized effect sizes where the expected weights of evidence is desired. Default: |
n1min |
Positive integer. Minimum sample size from Grpup-1 to be considered. Default: 20. |
n2min |
Positive integer. Minimum sample size from Grpup-2 to be considered. Default: 20. |
n1max |
Positive integer. Maximum sample size from Grpup-1 to be considered. Default: 5000. |
n2max |
Positive integer. Maximum sample size from Grpup-2 to be considered. Default: 5000. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
batch1.size.increment |
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 |
batch2.size.increment |
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 |
nReplicate |
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000. |
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.
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.
Sandipan Pramanik and Valen E. Johnson
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]
out = fixedNAP.twot_es(n1max = 100, n2max = 100)
out = fixedNAP.twot_es(n1max = 100, n2max = 100)
-tests with NAP and a pre-fixed sample size
In two-sided fixed design two-sample -tests with normal moment prior assumed on the difference between standardized effect sizes
under the alternative and a prefixed sample size, this function calculates the expected weights of evidence (that is, expected log(Bayes Factor)) of the test at a varied range of differences between standardized effect sizes.
fixedNAP.twot_n(es = c(0, 0.2, 0.3, 0.5), n1.fixed = 20, n2.fixed = 20, tau.NAP = 0.3/sqrt(2), nReplicate = 50000, nCore)
fixedNAP.twot_n(es = c(0, 0.2, 0.3, 0.5), n1.fixed = 20, n2.fixed = 20, tau.NAP = 0.3/sqrt(2), nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect size differences |
n1.fixed |
Positive integer. Prefixed sample size from Group-1. Default: 20. |
n2.fixed |
Positive integer. Prefixed sample size from Group-2. Default: 20. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
nReplicate |
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000. |
nCore |
Positive integer. Default: One less than the total number of available cores. |
A list with two components named summary
and BF
.
$summary
is a data frame with columns effect.size
containing the values in es
and avg.logBF
containing the expected weight of evidence values at those values.
$BF
is a matrix of dimension length(es)
by nReplicate
. Each row contains the Bayes factor values at the corresponding standardized effec size differences in nReplicate
replicated studies.
Sandipan Pramanik and Valen E. Johnson
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]
out = fixedNAP.twot_n(n1.fixed = 20, n2.fixed = 20, es = c(0, 0.3), nCore = 1)
out = fixedNAP.twot_n(n1.fixed = 20, n2.fixed = 20, es = c(0, 0.3), nCore = 1)
-tests with NAP for varied sample sizes
In two-sided fixed design two-sample -tests with normal moment prior assumed on the difference between standardized effect sizes
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)
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)
es |
Numeric. Difference between standardized effect sizes where the expected weights of evidence is desired. Default: |
n1min |
Positive integer. Minimum sample size from Grpup-1 to be considered. Default: 20. |
n2min |
Positive integer. Minimum sample size from Grpup-2 to be considered. Default: 20. |
n1max |
Positive integer. Maximum sample size from Grpup-1 to be considered. Default: 5000. |
n2max |
Positive integer. Maximum sample size from Grpup-2 to be considered. Default: 5000. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
sigma0 |
Positive numeric. Known common standard deviation of the populations. Default: 1. |
batch1.size.increment |
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 |
batch2.size.increment |
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 |
nReplicate |
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000. |
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.
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.
Sandipan Pramanik and Valen E. Johnson
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]
out = fixedNAP.twoz_es(n1max = 100, n2max = 100)
out = fixedNAP.twoz_es(n1max = 100, n2max = 100)
-tests with NAP and a pre-fixed sample size
In two-sided fixed design two-sample -tests with normal moment prior assumed on the difference between standardized effect sizes
under the alternative and a prefixed sample size, this function calculates the expected weights of evidence (that is, expected log(Bayes Factor)) of the test at a varied range of differences between standardized effect sizes.
fixedNAP.twoz_n(es = c(0, 0.2, 0.3, 0.5), n1.fixed = 20, n2.fixed = 20, tau.NAP = 0.3/sqrt(2), sigma0 = 1, nReplicate = 50000, nCore)
fixedNAP.twoz_n(es = c(0, 0.2, 0.3, 0.5), n1.fixed = 20, n2.fixed = 20, tau.NAP = 0.3/sqrt(2), sigma0 = 1, nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect size differences |
n1.fixed |
Positive integer. Prefixed sample size from Group-1. Default: 20. |
n2.fixed |
Positive integer. Prefixed sample size from Group-2. Default: 20. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
sigma0 |
Positive numeric. Known common standard deviation of the populations. Default: 1. |
nReplicate |
Positve integer. Number of replicated studies based on which the expected weights of evidence is calculated. Default: 50,000. |
nCore |
Positive integer. Default: One less than the total number of available cores. |
A list with two components named summary
and BF
.
$summary
is a data frame with columns effect.size
containing the values in es
and avg.logBF
containing the expected weight of evidence values at those values.
$BF
is a matrix of dimension length(es)
by nReplicate
. Each row contains the Bayes factor values at the corresponding standardized effec size differences in nReplicate
replicated studies.
Sandipan Pramanik and Valen E. Johnson
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]
out = fixedNAP.twoz_n(n1.fixed = 20, n2.fixed = 20, es = c(0, 0.3), nCore = 1)
out = fixedNAP.twoz_n(n1.fixed = 20, n2.fixed = 20, es = c(0, 0.3), nCore = 1)
tests
In a population with unknown variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. Based on an observed data, this function calculates the Hajnal's ratio in favor of
when the prior assumed on the standardized effect size
under the alternative places equal probability at
and
(
prefixed).
HajnalBF_onet(obs, nObs, mean.obs, sd.obs, test.statistic, es1 = 0.3)
HajnalBF_onet(obs, nObs, mean.obs, sd.obs, test.statistic, es1 = 0.3)
obs |
Numeric vector. Observed vector of data. |
nObs |
Numeric or numeric vector. Sample size(s). Same as |
mean.obs |
Numeric or numeric vector. Sample mean(s). Same as |
sd.obs |
Positive numeric or numeric vector. Sample standard deviation(s). Same as |
test.statistic |
Numeric or numeric vector. Test-statistic value(s). |
es1 |
Positive numeric. |
Users can either specify obs
, or nObs
, mean.obs
and sd.obs
, or nObs
and test.statistic
.
If obs
is provided, it returns the corresponding Bayes factor value.
If nObs
, mean.obs
and sd.obs
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
If nObs
and test.statistic
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
Positive numeric or numeric vector. The Hajnal's ratio(s).
Sandipan Pramanik and Valen E. Johnson
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].
HajnalBF_onet(obs = rnorm(100))
HajnalBF_onet(obs = rnorm(100))
tests
In a population with known variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. Based on an observed data, this function calculates the Hajnal's ratio in favor of
when the prior assumed on the standardized effect size
under the alternative places equal probability at
and
(
prefixed).
HajnalBF_onez(obs, nObs, mean.obs, test.statistic, es1 = 0.3, sigma0 = 1)
HajnalBF_onez(obs, nObs, mean.obs, test.statistic, es1 = 0.3, sigma0 = 1)
obs |
Numeric vector. Observed vector of data. |
nObs |
Numeric or numeric vector. Sample size(s). Same as |
mean.obs |
Numeric or numeric vector. Sample mean(s). Same as |
test.statistic |
Numeric or numeric vector. Test-statistic value(s). |
es1 |
Positive numeric. |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
Users can either specify obs
, or nObs
and mean.obs
, or nObs
and test.statistic
.
If obs
is provided, it returns the corresponding Bayes factor value.
If nObs
and mean.obs
are provided, the function is vectorized over both arguments. Bayes factor values corresponding to the values therein are returned.
If nObs
and test.statistic
are provided, the function is vectorized over both arguments. Bayes factor values corresponding to the values therein are returned.
Positive numeric or numeric vector. The Hajnal's ratio(s).
Sandipan Pramanik and Valen E. Johnson
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].
HajnalBF_onez(obs = rnorm(100))
HajnalBF_onez(obs = rnorm(100))
tests
In case of two independent populations and
with unknown common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. Based on an observed data, this function calculates the Hajnal's ratio in favor of
when the prior assumed under the alternative on the difference between standardized effect sizes
places equal probability at
and
(
prefixed).
HajnalBF_twot(obs1, obs2, n1Obs, n2Obs, mean.obs1, mean.obs2, sd.obs1, sd.obs2, test.statistic, es1 = 0.3)
HajnalBF_twot(obs1, obs2, n1Obs, n2Obs, mean.obs1, mean.obs2, sd.obs1, sd.obs2, test.statistic, es1 = 0.3)
obs1 |
Numeric vector. Observed vector of data from Group-1. |
obs2 |
Numeric vector. Observed vector of data from Group-2. |
n1Obs |
Numeric or numeric vector. Sample size(s) from Group-1. Same as |
n2Obs |
Numeric or numeric vector. Sample size(s) from Group-2. Same as |
mean.obs1 |
Numeric or numeric vector. Sample mean(s) from Group-1. Same as |
mean.obs2 |
Numeric or numeric vector. Sample mean(s) from Group-2. Same as |
sd.obs1 |
Numeric or numeric vector. Sample standard deviations(s) from Group-1. Same as |
sd.obs2 |
Numeric or numeric vector. Sample standard deviations(s) from Group-2. Same as |
test.statistic |
Numeric or numeric vector. Test-statistic value(s). |
es1 |
Positive numeric. |
A user can either specify obs1
and obs2
, or n1Obs
, n2Obs
, mean.obs1
, mean.obs2
, sd.obs1
and sd.obs2
, or n1Obs
, n2Obs
, and test.statistic
.
If obs1
and obs2
are provided, it returns the corresponding Bayes factor value.
If n1Obs
, n2Obs
, mean.obs1
, mean.obs2
, sd.obs1
and sd.obs2
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
If n1Obs
, n2Obs
, and test.statistic
are provided, the function is vectorized over each of the arguments. Bayes factor values corresponding to the values therein are returned.
Positive numeric or numeric vector. The Hajnal's ratio(s).
Sandipan Pramanik and Valen E. Johnson
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].
HajnalBF_twot(obs1 = rnorm(100), obs2 = rnorm(100))
HajnalBF_twot(obs1 = rnorm(100), obs2 = rnorm(100))
tests
In case of two independent populations and
with known common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. Based on an observed data, this function calculates the Hajnal's ratio in favor of
when the prior assumed under the alternative on the difference between standardized effect sizes
places equal probability at
and
(
prefixed).
HajnalBF_twoz(obs1, obs2, n1Obs, n2Obs, mean.obs1, mean.obs2, test.statistic, es1 = 0.3, sigma0 = 1)
HajnalBF_twoz(obs1, obs2, n1Obs, n2Obs, mean.obs1, mean.obs2, test.statistic, es1 = 0.3, sigma0 = 1)
obs1 |
Numeric vector. Observed vector of data from Group-1. |
obs2 |
Numeric vector. Observed vector of data from Group-2. |
n1Obs |
Numeric or numeric vector. Sample size(s) from Group-1. Same as |
n2Obs |
Numeric or numeric vector. Sample size(s) from Group-2. Same as |
mean.obs1 |
Numeric or numeric vector. Sample mean(s) from Group-1. Same as |
mean.obs2 |
Numeric or numeric vector. Sample mean(s) from Group-2. Same as |
test.statistic |
Numeric or numeric vector. Test-statistic value(s). |
es1 |
Positive numeric. |
sigma0 |
Positive numeric. Known common standard deviation of the populations. Default: 1. |
A user can either specify obs1
and obs2
, or n1Obs
, n2Obs
, mean.obs1
and mean.obs2
, or n1Obs
, n2Obs
, and test.statistic
.
If obs1
and obs2
are provided, it returns the corresponding Bayes factor value.
If n1Obs
, n2Obs
, mean.obs1
and mean.obs2
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
If n1Obs
, n2Obs
, and test.statistic
are provided, the function is vectorized over each of the arguments. Bayes factor values corresponding to the values therein are returned.
Positive numeric or numeric vector. The Hajnal's ratio(s).
Sandipan Pramanik and Valen E. Johnson
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].
HajnalBF_twoz(obs1 = rnorm(100), obs2 = rnorm(100))
HajnalBF_twoz(obs1 = rnorm(100), obs2 = rnorm(100))
-tests
In a population with unknown variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. For a sequentially observed data, this function implements the Sequential Bayes Factor design when the prior assumed on the standardized effect size
under the alternative places equal probability at
and
(
prefixed).
implement.SBFHajnal_onet(obs, es1 = 0.3, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size, return.plot = TRUE, until.decision.reached = TRUE)
implement.SBFHajnal_onet(obs, es1 = 0.3, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size, return.plot = TRUE, until.decision.reached = TRUE)
obs |
Numeric vector. The vector of sequentially observed data. |
es1 |
Positive numeric. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch.size |
Integer vector. The vector of batch sizes at each sequential comparison. Default: |
return.plot |
Logical. Whether a sequential comparison plot to be returned. Default: |
until.decision.reached |
Logical. Whether the sequential comparison is performed until a decision is reached or until the data is observed. Default: |
A list with three components named N
, BF
, and decision
.
$N
contains the number of sample size used.
$BF
contains the Bayes factor values at each sequential comparison.
$decision
contains the decision reached. 'A'
indicates acceptance of ,
'R'
indicates rejection of , and
'I'
indicates inconclusive.
Sandipan Pramanik and Valen E. Johnson
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].
out = implement.SBFHajnal_onet(obs = rnorm(100))
out = implement.SBFHajnal_onet(obs = rnorm(100))
-tests
In a population with known variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. For a sequentially observed data, this function implements the Sequential Bayes Factor design when the prior assumed on the standardized effect size
under the alternative places equal probability at
and
(
prefixed).
implement.SBFHajnal_onez(obs, es1 = 0.3, sigma0 = 1, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size, return.plot = TRUE, until.decision.reached = TRUE)
implement.SBFHajnal_onez(obs, es1 = 0.3, sigma0 = 1, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size, return.plot = TRUE, until.decision.reached = TRUE)
obs |
Numeric vector. The vector of sequentially observed data. |
es1 |
Positive numeric. |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch.size |
Integer vector. The vector of batch sizes at each sequential comparison. Default: |
return.plot |
Logical. Whether a sequential comparison plot to be returned. Default: |
until.decision.reached |
Logical. Whether the sequential comparison is performed until a decision is reached or until the data is observed. Default: |
A list with three components named N
, BF
, and decision
.
$N
contains the number of sample size used.
$BF
contains the Bayes factor values at each sequential comparison.
$decision
contains the decision reached. 'A'
indicates acceptance of ,
'R'
indicates rejection of , and
'I'
indicates inconclusive.
Sandipan Pramanik and Valen E. Johnson
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].
out = implement.SBFHajnal_onez(obs = rnorm(100))
out = implement.SBFHajnal_onez(obs = rnorm(100))
-tests
In case of two independent populations and
with unknown common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. 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
under the alternative.
implement.SBFHajnal_twot(obs1, obs2, es1 = 0.3, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch1.size, batch2.size, return.plot = TRUE, until.decision.reached = TRUE)
implement.SBFHajnal_twot(obs1, obs2, es1 = 0.3, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch1.size, batch2.size, return.plot = TRUE, until.decision.reached = TRUE)
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. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch1.size |
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: |
batch2.size |
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: |
return.plot |
Logical. Whether a sequential comparison plot to be returned. Default: |
until.decision.reached |
Logical. Whether the sequential comparison is performed until a decision is reached or until the data is observed. Default: |
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 ,
'R'
indicates rejection of , and
'I'
indicates inconclusive.
Sandipan Pramanik and Valen E. Johnson
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].
out = implement.SBFHajnal_twot(obs1 = rnorm(100), obs2 = rnorm(100))
out = implement.SBFHajnal_twot(obs1 = rnorm(100), obs2 = rnorm(100))
-tests
In case of two independent populations and
with known common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. 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
under the alternative.
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)
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)
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. |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch1.size |
Integer vector. The vector of batch sizes from Group-1 at each sequential comparison. Default: |
batch2.size |
Integer vector. The vector of batch sizes from Group-2 at each sequential comparison. Default: |
return.plot |
Logical. Whether a sequential comparison plot to be returned. Default: |
until.decision.reached |
Logical. Whether the sequential comparison is performed until a decision is reached or until the data is observed. Default: |
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 ,
'R'
indicates rejection of , and
'I'
indicates inconclusive.
Sandipan Pramanik and Valen E. Johnson
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].
out = implement.SBFHajnal_twoz(obs1 = rnorm(100), obs2 = rnorm(100))
out = implement.SBFHajnal_twoz(obs1 = rnorm(100), obs2 = rnorm(100))
-tests
In a population with unknown variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. For a sequentially observed data, this function implements the Sequential Bayes Factor design when a normal moment prior is assumed on the standardized effect size
under the alternative.
implement.SBFNAP_onet(obs, tau.NAP = 0.3/sqrt(2), RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size, return.plot = TRUE, until.decision.reached = TRUE)
implement.SBFNAP_onet(obs, tau.NAP = 0.3/sqrt(2), RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size, return.plot = TRUE, until.decision.reached = TRUE)
obs |
Numeric vector. The vector of sequentially observed data. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch.size |
Integer vector. The vector of batch sizes at each sequential comparison. The first element (the first batch size) needs to be at least 2. Default: |
return.plot |
Logical. Whether a sequential comparison plot to be returned. Default: |
until.decision.reached |
Logical. Whether the sequential comparison is performed until a decision is reached or until the data is observed. Default: |
A list with three components named N
, BF
, and decision
.
$N
contains the number of sample size used.
$BF
contains the Bayes factor values at each sequential comparison.
$decision
contains the decision reached. 'A'
indicates acceptance of ,
'R'
indicates rejection of , and
'I'
indicates inconclusive.
Sandipan Pramanik and Valen E. Johnson
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]
out = implement.SBFNAP_onet(obs = rnorm(100))
out = implement.SBFNAP_onet(obs = rnorm(100))
-tests
In a population with known variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. For a sequentially observed data, this function implements the Sequential Bayes Factor design when a normal moment prior is assumed on the standardized effect size
under the alternative.
implement.SBFNAP_onez(obs, sigma0 = 1, tau.NAP = 0.3/sqrt(2), RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size, return.plot = TRUE, until.decision.reached = TRUE)
implement.SBFNAP_onez(obs, sigma0 = 1, tau.NAP = 0.3/sqrt(2), RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size, return.plot = TRUE, until.decision.reached = TRUE)
obs |
Numeric vector. The vector of sequentially observed data. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch.size |
Integer vector. The vector of batch sizes at each sequential comparison. Default: |
return.plot |
Logical. Whether a sequential comparison plot to be returned. Default: |
until.decision.reached |
Logical. Whether the sequential comparison is performed until a decision is reached or until the data is observed. Default: |
A list with three components named N
, BF
, and decision
.
$N
contains the number of sample size used.
$BF
contains the Bayes factor values at each sequential comparison.
$decision
contains the decision reached. 'A'
indicates acceptance of ,
'R'
indicates rejection of , and
'I'
indicates inconclusive.
Sandipan Pramanik and Valen E. Johnson
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]
out = implement.SBFNAP_onez(obs = rnorm(100))
out = implement.SBFNAP_onez(obs = rnorm(100))
-tests
In case of two independent populations and
with unknown common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. 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
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)
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)
obs1 |
Numeric vector. The vector of sequentially observed data from Group-1. |
obs2 |
Numeric vector. The vector of sequentially observed data from Group-2. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch1.size |
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: |
batch2.size |
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: |
return.plot |
Logical. Whether a sequential comparison plot to be returned. Default: |
until.decision.reached |
Logical. Whether the sequential comparison is performed until a decision is reached or until the data is observed. Default: |
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 ,
'R'
indicates rejection of , and
'I'
indicates inconclusive.
Sandipan Pramanik and Valen E. Johnson
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]
out = implement.SBFNAP_twot(obs1 = rnorm(100), obs2 = rnorm(100))
out = implement.SBFNAP_twot(obs1 = rnorm(100), obs2 = rnorm(100))
-tests
In case of two independent populations and
with known common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. 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
under the alternative.
implement.SBFNAP_twoz(obs1, obs2, sigma0 = 1, 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)
implement.SBFNAP_twoz(obs1, obs2, sigma0 = 1, 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)
obs1 |
Numeric vector. The vector of sequentially observed data from Group-1. |
obs2 |
Numeric vector. The vector of sequentially observed data from Group-2. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch1.size |
Integer vector. The vector of batch sizes from Group-1 at each sequential comparison. Default: |
batch2.size |
Integer vector. The vector of batch sizes from Group-2 at each sequential comparison. Default: |
return.plot |
Logical. Whether a sequential comparison plot to be returned. Default: |
until.decision.reached |
Logical. Whether the sequential comparison is performed until a decision is reached or until the data is observed. Default: |
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 ,
'R'
indicates rejection of , and
'I'
indicates inconclusive.
Sandipan Pramanik and Valen E. Johnson
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]
out = implement.SBFNAP_twoz(obs1 = rnorm(100), obs2 = rnorm(100))
out = implement.SBFNAP_twoz(obs1 = rnorm(100), obs2 = rnorm(100))
Helper function for combining outputs from replicated studies in fixed design tests.
mycombine.fixed(...)
mycombine.fixed(...)
... |
Lists. Outputs from different replicated studies. |
A list with two components combining the outputs from replicated studies.
Sandipan Pramanik and Valen E. Johnson
Helper function for combining outputs from replicated studies in one-sample tests using Sequential Bayes Factor.
mycombine.seq.onesample(...)
mycombine.seq.onesample(...)
... |
Lists. Outputs from different replicated studies. |
A list with three components combining the outputs from replicated studies.
Sandipan Pramanik and Valen E. Johnson
Helper function for combining results in two-sample tests using Sequential Bayes Factor.
mycombine.seq.twosample(...)
mycombine.seq.twosample(...)
... |
Lists. Outputs from different replicated studies. |
A list with four components combining the outputs from replicated studies.
Sandipan Pramanik and Valen E. Johnson
tests
In a population with unknown variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. Based on an observed data, this function calculates the Bayes factor in favor of
when a normal moment prior is assumed on the standardized effect size
under the alternative. Under both hypotheses, the Jeffrey's prior
is assumed on
.
NAPBF_onet(obs, nObs, mean.obs, sd.obs, test.statistic, tau.NAP = 0.3/sqrt(2))
NAPBF_onet(obs, nObs, mean.obs, sd.obs, test.statistic, tau.NAP = 0.3/sqrt(2))
obs |
Numeric vector. Observed vector of data. |
nObs |
Numeric or numeric vector. Sample size(s). Same as |
mean.obs |
Numeric or numeric vector. Sample mean(s). Same as |
sd.obs |
Positive numeric or numeric vector. Sample standard deviation(s). Same as |
test.statistic |
Numeric or numeric vector. Test-statistic value(s). |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
Users can either specify obs
, or nObs
, mean.obs
and sd.obs
, or nObs
and test.statistic
.
If obs
is provided, it returns the corresponding Bayes factor value.
If nObs
, mean.obs
and sd.obs
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
If nObs
and test.statistic
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
Positive numeric or numeric vector. The Bayes factor value(s).
Sandipan Pramanik and Valen E. Johnson
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]
NAPBF_onet(obs = rnorm(100))
NAPBF_onet(obs = rnorm(100))
tests
In a population with known variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. Based on an observed data, this function calculates the Bayes factor in favor of
when a normal moment prior is assumed on the standardized effect size
under the alternative.
NAPBF_onez(obs, nObs, mean.obs, test.statistic, tau.NAP = 0.3/sqrt(2), sigma0 = 1)
NAPBF_onez(obs, nObs, mean.obs, test.statistic, tau.NAP = 0.3/sqrt(2), sigma0 = 1)
obs |
Numeric vector. Observed vector of data. |
nObs |
Numeric or numeric vector. Sample size(s). Same as |
mean.obs |
Numeric or numeric vector. Sample mean(s). Same as |
test.statistic |
Numeric or numeric vector. Test-statistic value(s). |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
Users can either specify obs
, or nObs
and mean.obs
, or nObs
and test.statistic
.
If obs
is provided, it returns the corresponding Bayes factor value.
If nObs
and mean.obs
are provided, the function is vectorized over both arguments. Bayes factor values corresponding to the values therein are returned.
If nObs
and test.statistic
are provided, the function is vectorized over both arguments. Bayes factor values corresponding to the values therein are returned.
Positive numeric or numeric vector. The Bayes factor value(s).
Sandipan Pramanik and Valen E. Johnson
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]
NAPBF_onez(obs = rnorm(100))
NAPBF_onez(obs = rnorm(100))
tests
In case of two independent populations and
with unknown common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. Based on an observed data, this function calculates the Bayes factor in favor of
when a normal moment prior is assumed on the difference between standardized effect sizes
under the alternative. Under both hypotheses, the Jeffrey's prior
is assumed on
.
NAPBF_twot(obs1, obs2, n1Obs, n2Obs, mean.obs1, mean.obs2, sd.obs1, sd.obs2, test.statistic, tau.NAP = 0.3/sqrt(2))
NAPBF_twot(obs1, obs2, n1Obs, n2Obs, mean.obs1, mean.obs2, sd.obs1, sd.obs2, test.statistic, tau.NAP = 0.3/sqrt(2))
obs1 |
Numeric vector. Observed vector of data from Group-1. |
obs2 |
Numeric vector. Observed vector of data from Group-2. |
n1Obs |
Numeric or numeric vector. Sample size(s) from Group-1. Same as |
n2Obs |
Numeric or numeric vector. Sample size(s) from Group-2. Same as |
mean.obs1 |
Numeric or numeric vector. Sample mean(s) from Group-1. Same as |
mean.obs2 |
Numeric or numeric vector. Sample mean(s) from Group-2. Same as |
sd.obs1 |
Numeric or numeric vector. Sample standard deviations(s) from Group-1. Same as |
sd.obs2 |
Numeric or numeric vector. Sample standard deviations(s) from Group-2. Same as |
test.statistic |
Numeric or numeric vector. Test-statistic value(s). |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
A user can either specify obs1
and obs2
, or n1Obs
, n2Obs
, mean.obs1
, mean.obs2
, sd.obs1
and sd.obs2
, or n1Obs
, n2Obs
, and test.statistic
.
If obs1
and obs2
are provided, it returns the corresponding Bayes factor value.
If n1Obs
, n2Obs
, mean.obs1
, mean.obs2
, sd.obs1
and sd.obs2
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
If n1Obs
, n2Obs
, and test.statistic
are provided, the function is vectorized over each of the arguments. Bayes factor values corresponding to the values therein are returned.
Positive numeric or numeric vector. The Bayes factor value(s).
Sandipan Pramanik and Valen E. Johnson
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]
NAPBF_twot(obs1 = rnorm(100), obs2 = rnorm(100))
NAPBF_twot(obs1 = rnorm(100), obs2 = rnorm(100))
tests
In case of two independent populations and
with known common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. Based on an observed data, this function calculates the Bayes factor in favor of
when a normal moment prior is assumed on the difference between standardized effect sizes
under the alternative.
NAPBF_twoz(obs1, obs2, n1Obs, n2Obs, mean.obs1, mean.obs2, test.statistic, tau.NAP = 0.3/sqrt(2), sigma0 = 1)
NAPBF_twoz(obs1, obs2, n1Obs, n2Obs, mean.obs1, mean.obs2, test.statistic, tau.NAP = 0.3/sqrt(2), sigma0 = 1)
obs1 |
Numeric vector. Observed vector of data from Group-1. |
obs2 |
Numeric vector. Observed vector of data from Group-2. |
n1Obs |
Numeric or numeric vector. Sample size(s) from Group-1. Same as |
n2Obs |
Numeric or numeric vector. Sample size(s) from Group-2. Same as |
mean.obs1 |
Numeric or numeric vector. Sample mean(s) from Group-1. Same as |
mean.obs2 |
Numeric or numeric vector. Sample mean(s) from Group-2. Same as |
test.statistic |
Numeric or numeric vector. Test-statistic value(s). |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
sigma0 |
Positive numeric. Known common standard deviation of the populations. Default: 1. |
A user can either specify obs1
and obs2
, or n1Obs
, n2Obs
, mean.obs1
and mean.obs2
, or n1Obs
, n2Obs
, and test.statistic
.
If obs1
and obs2
are provided, it returns the corresponding Bayes factor value.
If n1Obs
, n2Obs
, mean.obs1
and mean.obs2
are provided, the function is vectorized over the arguments. Bayes factor values corresponding to the values therein are returned.
If n1Obs
, n2Obs
, and test.statistic
are provided, the function is vectorized over each of the arguments. Bayes factor values corresponding to the values therein are returned.
Positive numeric or numeric vector. The Bayes factor value(s).
Sandipan Pramanik and Valen E. Johnson
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]
NAPBF_twoz(obs1 = rnorm(100), obs2 = rnorm(100))
NAPBF_twoz(obs1 = rnorm(100), obs2 = rnorm(100))
-tests
In a population with unknown variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. This function calculates the operating characteristics (OC) and average sample number (ASN) of the Sequential Bayes Factor design when the prior assumed on the standardized effect size
under the alternative places equal probability at
and
(
prefixed).
SBFHajnal_onet(es = c(0, 0.2, 0.3, 0.5), es1 = 0.3, nmin = 2, nmax = 5000, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size.increment, nReplicate = 50000, nCore)
SBFHajnal_onet(es = c(0, 0.2, 0.3, 0.5), es1 = 0.3, nmin = 2, nmax = 5000, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size.increment, nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect sizes |
es1 |
Positive numeric. |
nmin |
Positive integer. Minimum sample size in the sequential comparison. Should be at least 2. Default: 1. |
nmax |
Positive integer. Maximum sample size in the sequential comparison. Default: 1. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch.size.increment |
function. Increment in sample size at each sequential step. Default: |
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. |
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.
Sandipan Pramanik and Valen E. Johnson
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].
out = SBFHajnal_onet(nmax = 50, es = c(0, 0.3), nCore = 1)
out = SBFHajnal_onet(nmax = 50, es = c(0, 0.3), nCore = 1)
-tests
In a population with known variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. This function calculates the operating characteristics (OC) and average sample number (ASN) of the Sequential Bayes Factor design when the prior assumed on the standardized effect size
under the alternative places equal probability at
and
(
prefixed).
SBFHajnal_onez(es = c(0, 0.2, 0.3, 0.5), es1 = 0.3, nmin = 1, nmax = 5000, sigma0 = 1, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size.increment, nReplicate = 50000, nCore)
SBFHajnal_onez(es = c(0, 0.2, 0.3, 0.5), es1 = 0.3, nmin = 1, nmax = 5000, sigma0 = 1, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size.increment, nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect sizes |
es1 |
Positive numeric. |
nmin |
Positive integer. Minimum sample size in the sequential comparison. Default: 1. |
nmax |
Positive integer. Maximum sample size in the sequential comparison. Default: 1. |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch.size.increment |
function. Increment in sample size at each sequential step. Default: |
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. |
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.
Sandipan Pramanik and Valen E. Johnson
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].
out = SBFHajnal_onez(nmax = 100, es = c(0, 0.3), nCore = 1)
out = SBFHajnal_onez(nmax = 100, es = c(0, 0.3), nCore = 1)
-tests
In case of two independent populations and
with unknown common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. This function calculates the operating characteristics (OC) and average sample number (ASN) of the Sequential Bayes Factor design when the prior assumed under the alternative on the difference between standardized effect sizes
places equal probability at
and
(
prefixed).
SBFHajnal_twot(es = c(0, 0.2, 0.3, 0.5), es1 = 0.3, n1min = 2, n2min = 2, n1max = 5000, n2max = 5000, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch1.size.increment, batch2.size.increment, nReplicate = 50000, nCore)
SBFHajnal_twot(es = c(0, 0.2, 0.3, 0.5), es1 = 0.3, n1min = 2, n2min = 2, n1max = 5000, n2max = 5000, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch1.size.increment, batch2.size.increment, nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect size differences |
es1 |
Positive numeric. |
n1min |
Positive integer. Minimum sample size from Group-1 in the sequential comparison. Should be at least 2. Default: 1. |
n2min |
Positive integer. Minimum sample size from Group-2 in the sequential comparison. Should be at least 2. Default: 1. |
n1max |
Positive integer. Maximum sample size from Group-1 in the sequential comparison. Default: 1. |
n2max |
Positive integer. Maximum sample size from Group-2 in the sequential comparison. Default: 1. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch1.size.increment |
function. Increment in sample size from Group-1 at each sequential step. Default: |
batch2.size.increment |
function. Increment in sample size from Group-2 at each sequential step. Default: |
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. |
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.
Sandipan Pramanik and Valen E. Johnson
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].
out = SBFHajnal_twot(n1max = 100, n2max = 100, es = c(0, 0.3), nCore = 1)
out = SBFHajnal_twot(n1max = 100, n2max = 100, es = c(0, 0.3), nCore = 1)
-tests
In case of two independent populations and
with known common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. This function calculates the operating characteristics (OC) and average sample number (ASN) of the Sequential Bayes Factor design when the prior assumed under the alternative on the difference between standardized effect sizes
places equal probability at
and
(
prefixed).
SBFHajnal_twoz(es = c(0, 0.2, 0.3, 0.5), es1 = 0.3, n1min = 1, n2min = 1, n1max = 5000, n2max = 5000, sigma0 = 1, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch1.size.increment, batch2.size.increment, nReplicate = 50000, nCore)
SBFHajnal_twoz(es = c(0, 0.2, 0.3, 0.5), es1 = 0.3, n1min = 1, n2min = 1, n1max = 5000, n2max = 5000, sigma0 = 1, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch1.size.increment, batch2.size.increment, nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect size differences |
es1 |
Positive numeric. |
n1min |
Positive integer. Minimum sample size from Group-1 in the sequential comparison. Default: 1. |
n2min |
Positive integer. Minimum sample size from Group-2 in the sequential comparison. Default: 1. |
n1max |
Positive integer. Maximum sample size from Group-1 in the sequential comparison. Default: 1. |
n2max |
Positive integer. Maximum sample size from Group-2 in the sequential comparison. Default: 1. |
sigma0 |
Positive numeric. Known common standard deviation of the populations. Default: 1. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch1.size.increment |
function. Increment in sample size from Group-1 at each sequential step. Default: |
batch2.size.increment |
function. Increment in sample size from Group-2 at each sequential step. Default: |
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. |
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.
Sandipan Pramanik and Valen E. Johnson
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].
out = SBFHajnal_twoz(n1max = 100, n2max = 100, es = c(0, 0.3), nCore = 1)
out = SBFHajnal_twoz(n1max = 100, n2max = 100, es = c(0, 0.3), nCore = 1)
-tests
In a population with unknown variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. 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
under the alternative.
SBFNAP_onet(es = c(0, 0.2, 0.3, 0.5), nmin = 2, nmax = 5000, tau.NAP = 0.3/sqrt(2), RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size.increment, nReplicate = 50000, nCore)
SBFNAP_onet(es = c(0, 0.2, 0.3, 0.5), nmin = 2, nmax = 5000, tau.NAP = 0.3/sqrt(2), RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch.size.increment, nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect sizes |
nmin |
Positive integer. Minimum sample size in the sequential comparison. Should be at least 2. Default: 1. |
nmax |
Positive integer. Maximum sample size in the sequential comparison. Default: 1. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch.size.increment |
function. Increment in sample size at each sequential step. Default: |
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. |
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.
Sandipan Pramanik and Valen E. Johnson
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]
out = SBFNAP_onet(nmax = 100, es = c(0, 0.3), nCore = 1)
out = SBFNAP_onet(nmax = 100, es = c(0, 0.3), nCore = 1)
-tests
In a population with known variance
, consider the two-sided one-sample
-test for testing the point null hypothesis
against
. 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
under the alternative.
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)
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)
es |
Numeric vector. Standardized effect sizes |
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: |
sigma0 |
Positive numeric. Known standard deviation in the population. Default: 1. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch.size.increment |
function. Increment in sample size at each sequential step. Default: |
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. |
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.
Sandipan Pramanik and Valen E. Johnson
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]
out = SBFNAP_onez(nmax = 100, es = c(0, 0.3), nCore = 1)
out = SBFNAP_onez(nmax = 100, es = c(0, 0.3), nCore = 1)
-tests
In case of two independent populations and
with unknown common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. 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 difference between standardized effect sizes
under the alternative.
SBFNAP_twot(es = c(0, 0.2, 0.3, 0.5), n1min = 2, n2min = 2, n1max = 5000, n2max = 5000, tau.NAP = 0.3/sqrt(2), RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch1.size.increment, batch2.size.increment, nReplicate = 50000, nCore)
SBFNAP_twot(es = c(0, 0.2, 0.3, 0.5), n1min = 2, n2min = 2, n1max = 5000, n2max = 5000, tau.NAP = 0.3/sqrt(2), RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch1.size.increment, batch2.size.increment, nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect size differences |
n1min |
Positive integer. Minimum sample size from Group-1 in the sequential comparison. Should be at least 2. Default: 1. |
n2min |
Positive integer. Minimum sample size from Group-2 in the sequential comparison. Should be at least 2. Default: 1. |
n1max |
Positive integer. Maximum sample size from Group-1 in the sequential comparison. Default: 1. |
n2max |
Positive integer. Maximum sample size from Group-2 in the sequential comparison. Default: 1. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch1.size.increment |
function. Increment in sample size from Group-1 at each sequential step. Default: |
batch2.size.increment |
function. Increment in sample size from Group-2 at each sequential step. Default: |
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. |
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.
Sandipan Pramanik and Valen E. Johnson
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]
out = SBFNAP_twot(n1max = 100, n2max = 100, es = c(0, 0.3), nCore = 1)
out = SBFNAP_twot(n1max = 100, n2max = 100, es = c(0, 0.3), nCore = 1)
-tests
In case of two independent populations and
with known common variance
, consider the two-sample
-test for testing the point null hypothesis of difference in their means
against
. 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 difference between standardized effect sizes
under the alternative.
SBFNAP_twoz(es = c(0, 0.2, 0.3, 0.5), n1min = 1, n2min = 1, n1max = 5000, n2max = 5000, tau.NAP = 0.3/sqrt(2), sigma0 = 1, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch1.size.increment, batch2.size.increment, nReplicate = 50000, nCore)
SBFNAP_twoz(es = c(0, 0.2, 0.3, 0.5), n1min = 1, n2min = 1, n1max = 5000, n2max = 5000, tau.NAP = 0.3/sqrt(2), sigma0 = 1, RejectH1.threshold = exp(-3), RejectH0.threshold = exp(3), batch1.size.increment, batch2.size.increment, nReplicate = 50000, nCore)
es |
Numeric vector. Standardized effect size differences |
n1min |
Positive integer. Minimum sample size from Group-1 in the sequential comparison. Default: 1. |
n2min |
Positive integer. Minimum sample size from Group-2 in the sequential comparison. Default: 1. |
n1max |
Positive integer. Maximum sample size from Group-1 in the sequential comparison. Default: 1. |
n2max |
Positive integer. Maximum sample size from Group-2 in the sequential comparison. Default: 1. |
tau.NAP |
Positive numeric. Parameter in the moment prior. Default: |
sigma0 |
Positive numeric. Known common standard deviation of the populations. Default: 1. |
RejectH1.threshold |
Positive numeric. |
RejectH0.threshold |
Positive numeric. |
batch1.size.increment |
function. Increment in sample size from Group-1 at each sequential step. Default: |
batch2.size.increment |
function. Increment in sample size from Group-2 at each sequential step. Default: |
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. |
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.
Sandipan Pramanik and Valen E. Johnson
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]
out = SBFNAP_twoz(n1max = 100, n2max = 100, es = c(0, 0.3), nCore = 1)
out = SBFNAP_twoz(n1max = 100, n2max = 100, es = c(0, 0.3), nCore = 1)