Description Usage Arguments Details See Also Examples
Bayes Factor for ttest and oneway ANOVA
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 
data 
A dataframe (or a tibble) from which variables specified are to be taken. A matrix or a table will not be accepted. 
x 
Either the grouping variable from the dataframe 
y 
The column in 
subject.id 
Relevant in case of repeated measures design ( 
paired 
Logical that decides whether the experimental design is
repeated measures/withinsubjects or betweensubjects. The default is

test.value 
A number specifying the value of the null hypothesis
(Default: 
bf.prior 
A number between 
... 
Arguments passed on to

If y
is NULL
, a onesample ttest will be carried out,
otherwise a twosample ttest will be carried out.
bf_contingency_tab
, bf_corr_test
,
bf_oneway_anova
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59  # for reproducibility
set.seed(123)
library(tidyBF)
#  oneway ANOVA 
# to get dataframe (betweensubjects)
bf_oneway_anova(
data = iris,
x = Species,
y = Sepal.Length,
bf.prior = 0.8,
output = "dataframe"
)
# to get expression (withinsubjects) (needs `BayesFactor 0.9.124.3` or above)
if (utils::packageVersion("BayesFactor") >= package_version("0.9.124.3")) {
bf_oneway_anova(
data = bugs_long,
x = condition,
y = desire,
subject.id = subject,
paired = TRUE,
output = "expression"
)
}
#  twosamples tests 
# to get dataframe (betweensubjects)
bf_ttest(
data = mtcars,
x = am,
y = wt,
paired = FALSE,
bf.prior = 0.880,
output = "dataframe"
)
# to get expression (withinsubjects)
bf_ttest(
data = dplyr::filter(bugs_long, condition %in% c("LDLF", "LDHF")),
x = condition,
y = desire,
subject.id = subject,
paired = TRUE,
bf.prior = 0.880,
output = "dataframe"
)
#  onesamples test 
# to get expression
bf_ttest(
data = iris,
x = Sepal.Length,
test.value = 5.85,
output = "expression"
)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.