View source: R/Bf_samplesize.R
Bf_samplesize | R Documentation |
This function calculates the minimum sample size required to obtain evidence for H1 or H0 using Bayes factors. It supports different likelihood and prior distributions and assumes equal group sizes for between-subject designs.
Bf_samplesize(
distribution_likelihood = c("normal", "t"),
distribution_prior = c("normal", "cauchy", "uniform"),
sd_of_theory,
tail = c(1, 2),
n_start,
n_end,
step,
sd1,
sd2 = NULL,
threshold = c(3, 6, 10),
tpr = c(0.5, 0.8, 0.9, 0.95)
)
distribution_likelihood |
Distribution for the likelihood function ("normal" or "t"). |
distribution_prior |
Distribution for the prior ("normal", "cauchy", or "uniform"). |
sd_of_theory |
The standard deviation of the theoretical distribution. |
tail |
The number of tails (1 or 2). |
n_start |
Starting sample size. |
n_end |
Maximum sample size. |
step |
Step size for sample size increments. |
sd1 |
Standard deviation of the first sample. |
sd2 |
Standard deviation of the second sample (for between-subject designs). |
threshold |
Bayes factor threshold for stopping. |
tpr |
True positive rate. |
A list with required sample sizes for H1 and H0.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.