Compute probability that \(t\)-test Bayes factor is smaller than a specified threshold (the power), or determine sample size to obtain a target power.
powertbf01(
n = NULL,
power = NULL,
k = 1/10,
null = 0,
plocation = 0,
pscale = 1/sqrt(2),
pdf = 1,
type = c("two.sample", "one.sample", "paired"),
alternative = c("two.sided", "less", "greater"),
dpm = plocation,
dpsd = pscale,
nrange = c(2, 10^4)
)Object of class "power.bftest", a list of the arguments
(including the computed one) augmented with method and note
elements
Sample size (per group)
Target power. Has to be NULL if n is specified.
Defaults to NULL
Bayes factor threshold. Defaults to 1/10, Jeffreys' threshold
for 'strong evidence' against the null hypothesis
Standardized mean difference under the point null hypothesis.
Defaults to 0
\(t\) prior location. Defaults to 0
\(t\) prior scale. Defaults to 1/sqrt(2)
\(t\) prior degrees of freedom. Defaults to 1 (a Cauchy
prior)
Type of \(t\)-test. Can be "two.sample" (default),
"one.sample", or "paired"
Direction of the test. Can be either "two.sided"
(default), "less", or "greater". The latter two truncate
the analysis prior to negative and positive effects, respectively. If set
to "less" or "greater", the power is only computed based on
data with effect estimates in the direction of the alternative
Mean of the normal design prior assigned to the standardized mean difference. Defaults to the analysis prior location
Standard deviation of the normal design prior assigned to the
standardized mean difference. Set to 0 to obtain a point prior at
the design prior mean. Defaults to the analysis prior scale
Sample size search range over which numerical search is
performed (only taken into account when n is NULL).
Defaults to c(2, 10^4)
Samuel Pawel
This function provides a similar interface as
stats::power.t.test. For some users, the low-level functions
ntbf01 (to directly compute the sample size for a fixed power) and
ptbf01 (to directly compute the power for a fixed sample size) may
also be useful.
plot.power.bftest, ptbf01, ntbf01, tbf01
## determine power
powertbf01(n = 146, k = 1/6, dpm = 0.5, dps = 0, alternative = "greater")
## determine sample size
powertbf01(power = 0.95, k = 1/6, dpm = 0.5, dps = 0, alternative = "greater")
Run the code above in your browser using DataLab