bcor.test: Bayesian Test for Association/Correlation Between Paired...

View source: R/mainWrappers.R

bcor.testR Documentation

Bayesian Test for Association/Correlation Between Paired Samples This mimics cor.test

Description

Bayesian Test for Association/Correlation Between Paired Samples This mimics cor.test

Usage

bcor.test(
  x,
  y,
  z = NULL,
  alternative = c("two.sided", "less", "greater"),
  method = c("pearson", "kendall", "spearman"),
  ciValue = 0.95,
  use = "pairwise.complete.obs",
  h0 = 0,
  kappa = 1,
  hyperGeoOverFlowThreshold = 25,
  oneThreshold = 0.001,
  var = 1
)

Arguments

x, y

numeric vectors of data values. x and y must have the same length

z

data frame of data values of the controlling variables.

alternative

indicates the alternative hypothesis and must be one of "two.sided", "greater" or "less". "greater" corresponds to positive association, "less" to negative association.

method

a character string indicating which correlation coefficient is to b used for the test. One of "pearson", "kendall" or "spearman".

ciValue

numeric in (0, 1) credible level for the returned credible interval.

h0

numeric between -1 and 1 that specifies the point null hypothesis

kappa

numeric > 0 that specifies the

hyperGeoOverFlowThreshold

numeric > 0 such that if log(bf10) > hyperGeoOverFlowThreshold then the Savage-Dickey adaptation is used for to compute the one-sided Bayes factors, instead of the analytical ones.

oneThreshold

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

var

numeric > 0 that specifies the asymptotic variance of the approximate likelihood for Kendall's tau

Value

A list with class "btest" containing the following components:

Examples

x <- rnorm(100)
y <- rnorm(100)

bcor.test(x, y)
bcor.test(x, y, method="kendall")

z <- data.frame(rnorm(100))
bcor.test(x, y, z)

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