Description Usage Arguments Details Value Author(s) References Examples
View source: R/DistContinuous.R
Calculate distances among individuals for continuous data. It is possible introduce two matrices (x, y) and calculate the distances between the two sets of rows or introduce only one matrix (x) and calculate the distances between its rows.
1 | DistContinuous(x, y = NULL, coef = "Pythagorean", r = 1)
|
x |
A matrix containing continuous data. |
y |
A matrix containing continuous data different from x. By default it is null. |
coef |
Coefficient to calculate continuous distances. By default we use Pythagorean distances. |
r |
For Minkowski distances. By default it is 1. |
The function calculates distances among individuals for matrices of continuous data using different distance measures. If two matrices are provided, distances among individuals, one from the first matrix and another from the second, are calculated. If only one matrix is provided, interdistances among its rows are calculated.
The following coefficients are calculated
1.- Pythagorean = sqrt(sum((y[i, ] - x[j, ])^2)/p)
2.- Taxonomic = sqrt(sum(((y[i,]-x[j,])^2)/r^2)/p)
3.- City = sum(abs(y[i,]-x[j,])/r)/p
4.- Minkowski = (sum((abs(y[i,]-x[j,])/r)^t)/p)^(1/t)
5.- Divergence = sqrt(sum((y[i,]-x[j,])^2/(y[i,]+x[j,])^2)/p)
6.- dif_sum = sum(abs(y[i,]-x[j,])/abs(y[i,]+x[j,]))/p
7.- Camberra = sum(abs(y[i,]-x[j,])/(abs(y[i,])+abs(x[j,])))
8.- Bray_Curtis = sum(abs(y[i,]-x[j,]))/sum(y[i,]+x[j,])
9.- Soergel = sum(abs(y[i,]-x[j,]))/sum(apply(rbind(y[i,],x[j,]),2,max))
10.- Ware_hedges = sum(abs(y[i,]-x[j,]))/sum(apply(rbind(y[i,],x[j,]),2,max))
A list with:
Data |
A matrix with the initial data (x matrix). |
SupData |
A matrix with the supplementary data (y matrix). |
D |
The matrix of distances. |
Coefficient |
The coefficient used. |
Laura Vicente-Gonzalez, Jose Luis Vicente-Villardon
Gower, J. C. (2006) Similarity dissimilarity and Distance, measures of. Encyclopedia of Statistical Sciences. 2nd. ed. Volume 12. Wiley
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.