Learn R Programming

BayesPower (version 1.0.1)

BF10.cor: Bayes factor for a Bayesian correlation test

Description

Calculate the Bayes factor (BF10) for a correlation, either against a point null or an interval null hypothesis.

Usage

BF10.cor(
  r,
  n,
  k,
  alpha,
  beta,
  h0,
  hypothesis,
  location,
  scale,
  dff,
  model,
  e = NULL
)

Value

The Bayes factor (BF10) for the correlation test.

Arguments

r

Observed correlation coefficient.

n

Sample size.

k

Parameter for the analysis default beta prior under the alternative hypothesis.

alpha

Parameter for the analysis beta prior under the alternative hypothesis.

beta

Parameter for the analysis beta prior under the alternative hypothesis.

h0

Null value of the correlation.

hypothesis

The hypothesis being tested: two-sided ("!="), right-sided (">"), or left-sided ("<").

location

Location parameter for the analysis prior under the alternative hypothesis.

scale

Scale parameter for the analysis normal moment prior under the alternative hypothesis.

dff

Degrees of freedom for the analysis prior under the alternative hypothesis (if applicable).

model

Statistical model of the analysis prior under the alternative hypothesis: default beta ("d_beta"), beta ("beta"), or normal moment ("NLP").

e

Optional numeric vector specifying bounds for an interval null; used if interval BF is calculated.

Examples

Run this code
BF10.cor(
  r = 0.3,
  n = 50,
  k = 1,
  alpha = 0.05,
  beta = 0.2,
  h0 = 0,
  hypothesis = "!=",
  location = 0,
  scale = 1,
  dff = 49,
  model = "d_beta"
)

Run the code above in your browser using DataLab