# NOT RUN {
# ------------------- two-samples tests -----------------------------------
# for reproducibility
set.seed(123)
library(statsExpressions)
# to get caption (default)
bf_ttest(
  data = mtcars,
  x = am,
  y = wt,
  paired = FALSE,
  bf.prior = 0.880
)
# to see results
bf_ttest(
  data = mtcars,
  x = am,
  y = wt,
  paired = FALSE,
  output = "results"
)
# for paired sample test
bf_ttest(
  data = dplyr::filter(
    statsExpressions::intent_morality,
    condition %in% c("accidental", "attempted"),
    harm == "Poisoning"
  ),
  x = condition,
  y = rating,
  paired = TRUE,
  output = "results"
)
# ------------------- one-samples test -----------------------------------
# to get caption (default)
bf_ttest(
  data = iris,
  x = Sepal.Length,
  test.value = 5.85,
  bf.prior = 0.8,
  output = "caption", k = 2
)
# to get results dataframe
bf_ttest(
  data = iris,
  x = Sepal.Length,
  test.value = 5.85,
  bf.prior = 0.8,
  output = "results"
)
# }
Run the code above in your browser using DataLab