bf_distribution | R Documentation |
Uses the default Bayes factor employed in the BayesFactor package.
bf_distribution(effect_size, sample_sizes, n_bayes_factors, rscale = sqrt(2)/2)
effect_size |
The assumed effect size d. |
sample_sizes |
A vector of sample sizes to be used in the simulation. Means the total sample sizes, i.e., the sample sizes across the two groups in the t test. |
n_bayes_factors |
How many Bayes factor should be computed. Is replicated for each of the elements in the vector 'sample_sizes'. |
rscale |
The scaling parameter in the Cauchy prior used in the Bayes factor computation. Defaults to 'sqrt(2) / 2'. |
A data.frame in long format where each row represents the simulation of a t test. Each row has four columns: 'logBF' - the natural logarithm of the Bayes factor; 'N' - the total sample size in the t test; 'eff_size' - the effect size; 'rscale' - the scaling parameter of the prior distribution.
Morey, R. D., & Rouder, J. N. (2015). BayesFactor: Computation of bayes factors for common designs. Retrieved from https://CRAN.R-project.org/package=BayesFactor
Rouder, J. N., Speckman, P. L., Sun, D., Morey, R. D., & Iverson, G. (2009). Bayesian t tests for accepting and rejecting the null hypothesis. Psychonomic Bulletin & Review, 16(2), 225–237.
bfs <- bf_distribution(effect_size = 0.5, sample_sizes = seq(50, 350, by = 50), n_bayes_factors = 300) ## Use `exp` to obtain the "normal" BF (not logarithm of the Bayes factor) tapply(exp(bfs$logBF), bfs$N, median)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.