Learn R Programming

perfectphyloR (version 0.2.1)

dCorTest: dCor test for similarity of two matrices

Description

This function performs dCor test for association between two distance matrices and computes permutation P value. Permutation P value is computed by randomly permuting rows and columns of the second distance matrix.

Usage

dCorTest(Dx, Dy, nperm)

Arguments

Dx

A numeric matrix of pairwise distances.

Dy

A second numeric matrix of pairwise distances.

nperm

The number of times to permute the rows and columns of Dy.

Value

A list contains RV coefficient and permutation P value.

References

G. J. Szekely, M. L. Rizzo, and N. K. Bakirov. (2007). Measuring and testing dependence by correlation of distances. The Annals of Statistics, 35(6):2769 - 2794.

Examples

Run this code
# NOT RUN {
x <- runif(8)
y <- runif(8)
# Distance matrices
distX = as.matrix(dist(x, upper = TRUE, diag = TRUE))
distY = as.matrix(dist(y, upper = TRUE, diag = TRUE))

dCorTest(Dx = distX, Dy = distY, nperm = 1000)

# }

Run the code above in your browser using DataLab