bf_corr_test: Bayes Factor for correlation test

Description Usage Arguments See Also Examples

View source: R/bf_corr_test.R

Description

Bayes Factor for correlation test

Usage

1
bf_corr_test(data, x, y, bf.prior = 0.707, ...)

Arguments

data

A dataframe (or a tibble) from which variables specified are to be taken. A matrix or a table will not be accepted.

x

The column in data containing the explanatory variable to be plotted on the x-axis. Can be entered either as a character string (e.g., "x") or as a bare expression (e.g, x).

y

The column in data containing the response (outcome) variable to be plotted on the y-axis. Can be entered either as a character string (e.g., "y") or as a bare expression (e.g, y).

bf.prior

A number between 0.5 and 2 (default 0.707), the prior width to use in calculating Bayes factors.

...

Arguments passed on to bf_extractor

conf.level

Confidence/Credible Interval (CI) level. Default to 0.95 (95%).

centrality

The point-estimates (centrality indices) to compute. Character (vector) or list with one or more of these options: "median", "mean", "MAP" or "all".

conf.method

The type of index used for Credible Interval. Can be "hdi" (default), "eti", or "si" (see si(), hdi(), eti() functions from bayestestR package).

k

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

top.text

Text to display on top of the Bayes Factor message. This is mostly relevant in the context of ggstatsplot functions.

output

If "expression", will return expression with statistical details, while "dataframe" will return a dataframe containing the results.

See Also

bf_contingency_tab, bf_oneway_anova, bf_ttest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# for reproducibility
set.seed(123)
library(tidyBF)

# to get dataframe
bf_corr_test(
  data = anscombe,
  x = x1,
  y = y4,
  bf.prior = 0.3,
  output = "dataframe"
)

# to get expression
bf_corr_test(
  data = anscombe,
  x = x1,
  y = y4,
  bf.prior = 0.8,
  output = "expression"
)

tidyBF documentation built on June 12, 2021, 9:06 a.m.