bf_caption_maker: Prepare caption with bayes factor in favor of null

Description Usage Arguments Examples

Description

Convenience function to write a caption message with bayes factors in favor of the null hypothesis.

Usage

1
bf_caption_maker(bf.df, k = 2, output = "null", caption = NULL, ...)

Arguments

bf.df

A dataframe containing two columns log_e_bf01 (for evidence in favor of null hypothesis) and bf.prior. If dataframe contains more than two rows, only the first row will be used.

k

Number of digits after decimal point (should be an integer) (Default: k = 2).

output

Can either be "null" (or "caption" or "H0", which will contain text for evidence in favor of the null hypothesis or H0) or "alternative" (or "title" or "H1") or "results", which will return a dataframe with results all the details).

caption

Text to display as caption (will be displayed on top of the bayes factor caption/message).

...

Additional arguments (ignored).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
set.seed(123)

# dataframe containing results
bf_results <-
  ggstatsplot::bf_extractor(BayesFactor::correlationBF(
    x = iris$Sepal.Length,
    y = iris$Petal.Length
  )) %>%
  dplyr::mutate(.data = ., bf.prior = 0.707)

# creating caption (for null)
ggstatsplot::bf_caption_maker(
  bf.df = bf_results,
  output = "null",
  k = 3,
  caption = "Note: Iris dataset"
)

# creating caption (for alternative)
ggstatsplot::bf_caption_maker(
  bf.df = bf_results,
  output = "alternative"
)

IndrajeetPatil/ggstatsplot documentation built on June 14, 2019, 9:55 a.m.