mdc_test {MDCcure}R Documentation

MDC-Based Dependence Tests Between Multivariate Data and a Covariate

Description

Computes dependence between a multivariate dataset x and a univariate covariate y using different variants of the MDC (martingale difference correlation) test.

Usage

mdc_test(x, y, method, permutations = 999, parallel = TRUE, ncores = -1)

Arguments

x

Vector or matrix where rows represent samples, and columns represent variables.

y

Covariate vector.

method

Character string indicating the test to perform. One of:

  • "MDCU": U-centering permutation test.

  • "MDCV": Double-centering permutation test.

  • "FMDCU": Fast asymptotic test with U-centering.

  • "All": All of the above.

permutations

Number of permutations. Defaults to 999.

parallel

Logical. Whether to use parallel computing. Defaults to TRUE.

ncores

Number of threads for parallel computing (used only if parallel = TRUE).

Value

A list containing the test results and p-values.

References

Shao, X., and Zhang, J. (2014). Martingale difference correlation...

Examples

set.seed(123)
x <- matrix(rnorm(50 * 5), nrow = 50)
y <- rbinom(50, 1, 0.5)
mdc_test(x, y, method = "FMDCU")


[Package MDCcure version 0.1.0 Index]