
Bayesian correlation test.
bf_corr_test(
data,
x,
y,
bf.prior = 0.707,
caption = NULL,
output = "results",
k = 2L,
...
)
A dataframe (or a tibble) from which variables specified are to be taken. A matrix or tables will not be accepted.
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
).
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
).
A number between 0.5
and 2
(default 0.707
), the prior
width to use in calculating Bayes factors.
Text to display as caption (will be displayed on top of the Bayes Factor caption/message).
Can either be "null"
(or "caption"
or "H0"
or "h0"
),
which will return expression with evidence in favor of the null hypothesis,
or "alternative"
(or "title"
or "H1"
or "h1"
), which will return
expression with evidence in favor of the alternative hypothesis, or
"results"
, which will return a dataframe with results all the details).
Number of digits after decimal point (should be an integer)
(Default: k = 2L
).
Additional arguments passed to
parameters::model_parameters.BFBayesFactor()
.
# NOT RUN {
# for reproducibility
set.seed(123)
# to see results
bf_corr_test(
data = anscombe,
x = x1,
y = y4,
bf.prior = 1
)
# to get caption
bf_corr_test(
data = anscombe,
x = x1,
y = y4,
bf.prior = 0.8,
output = "null"
)
# }
Run the code above in your browser using DataLab