Learn R Programming

extracat (version 1.7-6)

dcorMVtable: Multivariate Distance Correlation for two sets of variables

Description

Computes the distances within two sets of variables and the corresponding distance correlation.

Usage

dcorMVtable(x, ind = 1, method = "euclidean")

Arguments

x

A contingency table of class table.

ind

The indices for the first set of variables. The second set consists of all remaining variables.

method

The method for dist

Value

The distance correlation between 0 and 1 for the distances from the two sets of variables.

See Also

dcorMVdata, wdcor, approx.dcor

Examples

Run this code
# NOT RUN {
	A2 <- arsim(2000,c(8,9),5,0.1)
	A2 <- optile(A2, iter=100)
	BCI(A2)
	wdcor(A2)
	
	p1 <- runif(11)+0.1
	p1 <- p1/sum(p1)
	A2b <- apply(A2,1:2,function(z) rmultinom(1,z,p1))
	
	# now the first variable is roughly independent from the other two:
	
	dcorMVtable(as.table(A2b),ind = 1)
	
	# here the third variable is NOT independent from the others:
	A3 <- arsim(2000,c(8,9,11),5,0.1)
	A3 <- optile(A3, iter=100)
	BCI(A3)
	dcorMVtable(A3,ind = 3)
	
	
# }

Run the code above in your browser using DataLab