Description Usage Arguments Value Author(s) References See Also Examples
Calculates the bivariate distance correlation for a given pair of variables, a numeric matrix or a data frame.
1 |
x |
A numeric vector, a numeric matrix or a data frame. In case of a data frame only the numeric variables are used. |
y |
A numeric vector. |
binning |
A logical value. Whether or not binning should be used. TRUE, "equi" for equidistant binng, "quant" for quantile based binning or "hexb" for hexagonal binning. Default is FALSE. |
b |
A positive integer. Number of bins in each variable. |
anchor |
A chraracter string or a numeric value. How should the anchor point be chosen? " |
parallel |
A logical value. Whether or not parallelization should be used. Default is FALSE. |
A numeric value describing the value of the measure if a pair of vectors is given. Otherwise a data frame with the following variables:
splines2d |
Value of the measure. |
x1 |
Number of first variable |
x2 |
Number of second variable. |
nx1 |
Name of first variable (missing if |
nx2 |
Name of second variable (missing if |
Katrin Grimm
G. J. Szekely, M. L. Rizzo und N. K. Bakirov (2007) Measuring and testing dependence by correlation of distances.The Annals of Statistics 35(6) 2769–2794.
A. Pilhoefer und A. Unwin (2013) New Approaches in Visualization of Categorical Data: R Package extracat Journal of Statistical Software 53(1) 1–25.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | data(Election2005)
## Not run:
# distance correlation for all pairs of variables
dcor <- dcor2d(Election2005)
# put the pairs in decreasing order
o_dcor <- dcor[order(dcor$dcor2d,decreasing=TRUE),]
# Show the 10 pairs with highest values
o_dcor[1:10,]
# Show the 4 scatterplots with highest values
par(mfrow=c(2,2))
for(i in 1:4){
plot(with(Election2005,get(as.character(o_dcor$nx1[i]))),
with(Election2005,get(as.character(o_dcor$nx2[i]))),
xlab=paste(o_dcor$nx1[i]),ylab=paste(o_dcor$nx2[i]),pch=19)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.