Calculate the Bayes factor (BF10) for a correlation coefficient, either against a point null
or an interval null hypothesis. Supports default beta ("d_beta"), stretched beta ("beta"),
and normal-moment ("Moment") priors for the alternative hypothesis.
BF10.cor(
r,
n,
k,
alpha,
beta,
h0,
alternative,
scale,
prior_analysis,
ROPE = NULL
)A list with class "BFvalue_r" containing:
type: "correlation"
bf10: Calculated Bayes factor BF10
h0: Null value of the correlation
r: Observed correlation coefficient
n: Sample size
analysis_h1: List with the analysis prior parameters: prior_analysis, k, alpha, beta, and scale.
alternative: the direction of the alternative hypothesis
ROPE: Interval bounds if specified
p.value: Numeric, p.value.
Numeric scalar. Observed correlation coefficient. Must be a numeric scalar between -1 and 1.
Numeric integer. Sample size. Must be a numeric scalar greater than 3.
Numeric scalar. Parameter for the analysis default beta prior ("d_beta") under the alternative hypothesis.
Numeric scalar. Parameter for the analysis beta prior ("beta") under the alternative hypothesis.
Numeric scalar. Parameter for the analysis beta prior ("beta") under the alternative hypothesis.
Numeric scalar. Null value of the correlation. Must be a numeric scalar between -0.8 and 0.8.
Character. The direction of the alternative hypothesis being tested: two-sided ("two.sided"), right-sided ("greater"), or left-sided ("less").
Numeric scalar. Scale parameter for the analysis normal-moment prior ("Moment"). Must be > 0.
Character. Analysis prior: default beta ("d_beta"), beta ("beta"), or normal-moment ("Moment").
Numeric vector. Optional numeric vector specifying bounds for an interval null hypothesis. For "two.sided", must be two distinct finite values between -0.5 and 0.5. For "greater" or "less", must satisfy additional bounds relative to h0.
BF10.cor(
r = 0.3930924,
n = 46,
prior_analysis = "d_beta",
k = 1,
h0 = 0,
alternative = "two.sided")
Run the code above in your browser using DataLab