ggstatsplot (version 0.0.8)

bf_corr_test: Bayesian correlation test.

Description

Bayesian correlation test.

Usage

bf_corr_test(data, x, y, bf.prior = 0.707, caption = NULL,
  output = "caption", k = 2)

Arguments

data

Dataframe from which variables are to be taken.

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.

caption

The text for the plot caption.

output

Can either be "caption" (which will contain text for evidence in favor of null) or "results" (which will return the dataframe with results).

k

Number of decimal places expected for results.

See Also

bf_contingency_tab, bf_oneway_anova, bf_two_sample_ttest

Examples

Run this code
# NOT RUN {
# for reproducibility
set.seed(123)

# to get caption (default)
bf_corr_test(
  data = anscombe,
  x = x1,
  y = y4,
  bf.prior = 1
)

# to see results
bf_corr_test(
  data = anscombe,
  x = x1,
  y = y4,
  bf.prior = 0.8,
  output = "results"
)
# }

Run the code above in your browser using DataCamp Workspace