| computeNPlanSafeZ | R Documentation |
Helper function: Computes nPlan based on meanDiffTrue, alpha and power
computeNPlanSaviZ(
meanDiffTrue,
power = 0.8,
alpha = 0.05,
alternative = c("twoSided", "less", "greater"),
testType = c("oneSample", "paired", "twoSample"),
sigma = 1,
kappa = sigma,
meanDiffMin = NULL,
beta = NULL,
ratio = 1,
parameter = NULL,
nMax = 1e+08,
eType = c("mom", "eGauss", "imom", "eCauchy", "grow"),
wantSamplePaths = TRUE,
wantSimData = TRUE,
pb = TRUE,
seed = NULL,
nSim = 1000L,
nBoot = nSim,
relevanceTest = FALSE,
relevanceSize = NULL,
alphaRelevance = NULL,
highN = 10000L,
...
)
meanDiffTrue |
numeric, data governing mean difference used for simulations. Default meanDiffTrue=meanDiffMin. |
beta |
numerical in (0,1). Old parameter now replaced by the power parameter |
alpha |
numeric in (0, 1) that specifies the tolerable type I error and the null rejection rule e >= 1/alpha. |
alternative |
a character string specifying the alternative hypothesis. Must be one of "twoSided" (default), "greater" or "less". |
testType |
either one of "oneSample", "paired", "twoSample". |
sigma |
numeric > 0 representing the assumed population standard deviation used to scale the data. |
kappa |
the true population standard deviation. Default kappa=sigma. |
ratio |
numeric > 0 representing the randomisation ratio of condition 2 over condition 1. If testType is not equal to "twoSample", or if nPlan is of length(1) then ratio=1. |
parameter |
numeric, an optional savi test defining parameter. Default set to |
nMax |
integer > 0, maximum sample size of the (first) sample in each sample path. |
eType |
character one of "mom", "grow", "eGauss", and "eCauchy". "mom" is default and uses a non-local moment prior with bump(s) at meanDiffMin, "grow" uses point prior(s) at meanDiffMin, "eGauss" a zero-centred normal prior, "eCauchy" a zero centred Cauchy prior. |
wantSamplePaths |
logical, if |
pb |
logical, if |
seed |
integer, seed number. |
nSim |
integer > 0, the number of simulations needed to compute power or the number of samples paths for the savi z test under continuous monitoring. |
nBoot |
integer > 0 representing the number of bootstrap samples to assess the accuracy of the approximations of the power, the number of samples for the savi z test under continuous monitoring,or for the computation of the logarithm of the implied target. |
relevanceTest |
logical, if |
... |
further arguments to be passed to or from methods. |
power |
numeric in (0, 1) that specifies the desired power, that is, the targetted chance to stop in favour of the alternative over the null hypothesis, when the alternative holds true. Note that prior to version 0.8.8 power <- 1-beta. The "beta" argument does not need to be specified anymore. |
meanDiffMin |
numeric that defines the minimal relevant mean difference, the smallest population mean difference that we would like to detect (with sufficient power). |
wantSimData |
logical, if |
relevanceSize |
numeric, the minimal clinical relevant mean difference that we do not want to miss under the alternative. Default relevanceSize=NULL implies relevanceSize=abs(meanDiffMin) |
alphaRelevance |
numeric, the threshold for relevance test. Taken to be minimum of alpha and 1-power. |
highN |
integer, largest possible sampling horizon. This might be the
largest n that we are able to fund, which by default is set to 1e4L.
Typically, highN is not used, as the function
|
a list which contains at least nPlan and an adapted bootObject of class boot.
computeNPlanSafeZ(): Deprecated version of computeNPlanSaviZ
Grünwald, P. D., de Heide, R., & Koolen, W. (2024). Safe testing. Journal of the Royal Statistical Society. Series B (Methodological), 86(5), 1091-1128. (With discussions), https://doi.org/10.1093/jrsssb/qkae011. Ly, A, Boehm, Grünwald, P. D., Ramdas, A., & van Ravenzwaaij, D. (2024). Safe Anytime-Valid Inference: Practical maximally flexible sampling designs for experiments based on e-values. PsyArXiv Preprint, https://doi.org/10.31234/osf.io/h5vae.
computeNPlanSaviZ(0.7, 0.2, nSim=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.