Learn R Programming

extracat (version 1.7-6)

dcorMVdata: Multivariate Distance Correlation for two sets of variables

Description

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

Usage

dcorMVdata(x, ind = 1, method = "euclidean", approx = FALSE)

Arguments

x

The data.frame which should only contain non-factor variables. For factor variables use xtabs in combination with dcorMVtable.

ind

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

method

The method for dist.

approx

FALSE for no approximation via binning or an integer value for the number of bins.

Value

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

See Also

dcorMVtable, wdcor, approx.dcor

Examples

Run this code
# NOT RUN {
	so <- scale(olives[,3:8])
	dcorMVdata(so,ind=1)
	
	p1 <- princomp(so)
	so1 <- cbind(so,p1$scores[,1])
	so2 <- cbind(so,p1$scores[,2])
	so12 <- cbind(so,p1$scores[,1:2])
	
	dcorMVdata(so1,ind=7)
	dcorMVdata(so2,ind=7)
	dcorMVdata(so12,ind=7:8)
	# how about principal curves?
# }

Run the code above in your browser using DataLab