bf10CorExact: Title

View source: R/pearson.R

bf10CorExactR Documentation

Title

Description

#' Exact bf10, bfPlus0, bfMin0 based on the exact

Usage

bf10CorExact(n, r, kappa = 1, h0 = 0, oneThreshold = 0.001)

Arguments

n

integer representing sample size

r

numeric in (-1, 1) sample Pearson correlation r

kappa

numeric > 0 sample

h0

numeric in (-1, 1) which represents the test point of H0

oneThreshold

numeric > 0 such that if abs(1 - stat) < oneThreshold, then abs(stat) is viewed as one.

methodNumber

integer either 1, or 2. Methodnumber 1 uses the exact results of Ly et.al (2018), whereas Methodnumber 2 uses the exact integral based on Jeffreys's approximation to the reduced likelihood.

hyperGeoOverFlowThreshold

integer set to 24. Some experiments show that when log(bf10) > 24, that the one-sided Bayes factors become instable [hypergeo v. 1.2-13]. For instance,

myN <- 300 myR <- 0.42 # 0.415

(bf10 <- bf10CorExact(n=myN, stat=myR)) (bfPlus0 <- bf10CorExact(n=myN, stat=myR) + mPlusCorExact(n=myN, stat=myR)) (bfMin0 <- bf10CorExact(n=myN, stat=myR) + mPlusCorExact(n=myN, stat=-myR))

Changing myR <- 0.42. Shows that the result is okay

Details

for Pearson's correlation based on the exact reduced likelihood, see Ly et al. (2018).

Value

Returns bf10, bfPlus0, bfMin0 and the stretched beta fit of the posterior.

Exact BF10 for Pearson's correlation based on the exact reduced likelihood, see Ly et al. (2018).

Returns Bayes factor BF10 in favour of the alternative over the null


AlexanderLyNL/bstats documentation built on Sept. 11, 2023, 4:10 p.m.