Last data update: 2014.03.03

R: Distance Between Groups
deltasR Documentation

Distance Between Groups

Description

Assume that n units are divided into k groups C1,...,Ck . Function deltas computes and returns the distance between each pair of groups. It uses the distances between pairs of units.

Usage

deltas(d, pert = "onegroup")

Arguments

d

a distance matrix or a dist object with distance information between units.

pert

an n-vector that indicates which group each unit belongs to. Note that the expected values of pert are numbers greater than or equal to 1 (for instance 1,2,3,4..., k). The default value indicates there is only one group in data.

Value

A matrix containing the distances between each pair of groups.

Author(s)

Itziar Irigoien itziar.irigoien@ehu.es; Konputazio Zientziak eta Adimen Artifiziala, Euskal Herriko Unibertsitatea (UPV-EHU), Donostia, Spain.

Conchita Arenas carenas@ub.edu; Departament d'Estadistica, Universitat de Barcelona, Barcelona, Spain.

References

Arenas, C. and Cuadras, C.M. (2002). Some recent statistical methods based on distances. Contributions to Science, 2, 183–191.

Cuadras, C.M., Fortiana, J. and Oliva, F. (1997). The proximity of an individual to a population with applications in discriminant analysis. Journal of Classification, 14, 117–136.

See Also

vgeo, proxi

Examples

data(iris)
d <- dist(iris[,1:4])
deltas(d,iris[,5])

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ICGE)
Loading required package: MASS
Loading required package: cluster
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ICGE/deltas.Rd_%03d_medium.png", width=480, height=480)
> ### Name: deltas
> ### Title: Distance Between Groups
> ### Aliases: deltas
> ### Keywords: multivariate
> 
> ### ** Examples
> 
> data(iris)
> d <- dist(iris[,1:4])
> deltas(d,iris[,5])
     
group        1         2         3
    1  0.00000 10.293068 22.605340
    2 10.29307  0.000000  2.625984
    3 22.60534  2.625984  0.000000
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>