powernmbf01 | R Documentation |
Compute probability that normal moment prior Bayes factor is smaller than a specified threshold (the power), or determine sample size to obtain a target power.
powernmbf01(
n = NULL,
power = NULL,
k = 1/10,
sd = 1,
null = 0,
psd,
type = c("two.sample", "one.sample", "paired"),
dpm,
dpsd,
nrange = c(1, 10^5)
)
n |
Sample size (per group for two-sample tests). Has to be |
power |
Target power. Has to be |
k |
Bayes factor threshold. Defaults to |
sd |
Standard deviation of one observation (for |
null |
Parameter value under the point null hypothesis. Defaults to
|
psd |
Spread of the normal moment prior assigned to the parameter under
the alternative in the analysis. The modes of the prior are located at
|
type |
The type of test. One of |
dpm |
Mean of the normal design prior assigned to the parameter |
dpsd |
Standard deviation of the normal design prior assigned to the parameter. Set to 0 to obtain a point prior at the design prior mean |
nrange |
Sample size search range over which numerical search is
performed (only taken into account when |
This function provides a similar interface as
stats::power.t.test
. It also assumes that the data are continuous
and that the parameter of interest is either a mean or a (standardized)
mean difference. For some users, the low-level functions nnmbf01
(to directly compute the sample size for a fixed power) and
pnmbf01 (to directly compute the power for a fixed sample size)
may also be useful because they can be used for other data and parameter
types.
Object of class "power.bftest"
, a list of the arguments
(including the computed one) augmented with method
and note
elements
Samuel Pawel
plot.power.bftest, nnmbf01, pnmbf01, nmbf01
## determine power
powernmbf01(n = 100, psd = 1, dpm = 0.5, dpsd = 0)
## determine sample size
powernmbf01(power = 0.99, psd = 1, dpm = 0.5, dpsd = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.