| bft | R Documentation |
Given a user-provided prior on the standardized effect size, will calculate the Bayes factor.
bft(t, nu, nd, prior = NULL)
t |
The observed t-statistic. |
nu |
The degrees of freedom of the t-statistic. This should be
|
nd |
Effective sample size. This should be |
prior |
The prior on the standardized effect size, |
Let \delta be the standardized effect size, let \sigma^2 be
the variance (assumed equal in two-sample case). In the one-sample case,
\delta = \frac{\mu - \mu_0}{\sigma}, where \mu_0 is the null
value. In the two-sample case, \delta = \frac{\mu_1 - \mu_2}{\sigma},
where \mu_1 and \mu_2 are the means of the two-samples. We place
the prior 1/\sigma^2 under the null and \pi(\delta)/\sigma^2
under the alternative, for some arbitrary density \pi(\cdot). Given
this setting, the Bayes factor is a function of the t-statistic.
We calculate it via numeric integration.
The Bayes factor to a corresponding t-statistic.
David Gerard
Gronau, Q. F., Ly, A., & Wagenmakers, E. J. (2020). Informed Bayesian t-tests. The American Statistician. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00031305.2018.1562983")}
# One sample t, n = 10, t-statistic = 2
bft(t = 2, nu = 10 - 1, nd = 10)
# Two sample t, n1 = 10, n2 = 8, t-statistic = 2
bft(t = 2, nu = 10 + 8 - 2, nd = 1 / (1 / 10 + 1 / 8))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.