| dcor.test | R Documentation |
Simple independence test based on data permutation using distance correlation and partial distance correlation.
dcor.test(x, y, R = 500, type = c("V", "U"))
pdcor.test(x, y, z, R = 500, type = c("U", "V"))
x |
the data of x |
y |
the data of y |
R |
the number of replicates |
type |
"U" or "V" |
z |
the data of controlling variables. Given z, pdcor between x and y is calculated. |
n = 200 z = rnorm(n) x = rnorm(n)*z y = rnorm(n)*z res1 = dcor.test(x,y,R=500) res2 = pdcor.test(x,y,z,R=500)