This function computes the Maximum distance (or L^Inf norm) between units in a dataset or between observations in two distinct datasets.
maximum.dist(data.x, data.y=data.x, rank=FALSE)
A matrix or a data frame containing variables that should be used in the computation of the distance. Only continuous variables are allowed. Missing values (
A numeric matrix or data frame with the same variables, of the same type, as those in
This function computes the L^Inf distance also know as minimax distance. In practice the distance between two records is the maximum of the absolute differences on the available variables:
rank=TRUE the original values are substituted by their ranks divided by the number of values plus one (following suggestion in Kovar et al. 1988).
matrix object with distances between rows of
data.x and those of
Marcello D'Orazio email@example.com
Kovar, J.G., MacMillan, J. and Whitridge, P. (1988). “Overview and strategy for the Generalized Edit and Imputation System”. Statistics Canada, Methodology Branch Working Paper No. BSMD 88-007 E/F.
md1 <- maximum.dist(iris[1:10,1:4]) md2 <- maximum.dist(iris[1:10,1:4], rank=TRUE) md3 <- maximum.dist(data.x=iris[1:50,1:4], data.y=iris[51:100,1:4]) md4 <- maximum.dist(data.x=iris[1:50,1:4], data.y=iris[51:100,1:4], rank=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.