Learn R Programming

perfectphyloR (version 0.2.1)

RVtest: RV test for association of two distance matrices

Description

This function performs RV test for similarity of two distance matrices. It permutes rows and columns of the second matrix randomly to calculate P value.

Usage

RVtest(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

Robert, P. and Escoufier, Y. (1976) A Unifying tool for linear multivariate statistical methods: the RV-coefficient. Applied Statistics, Vol.25, No.3, p. 257-265.

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))

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

# }

Run the code above in your browser using DataLab