proxi | R Documentation |
Assume that n units are divided into k groups C1,...,Ck. The function calculates the proximity function from a specific unit x0 to the groups Cj.
proxi(d, dx0, pert = "onegroup")
d |
a distance matrix or a |
dx0 |
an n-vector containing the distances from x0 to the other units. |
pert |
an n-vector that indicates which group each unit belongs to. Note that the expected values of |
k-vector containing the proximity function value from x0 to each group.
Itziar Irigoien itziar.irigoien@ehu.eus; 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.
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.
vgeo
, deltas
data(iris) d <- dist(iris[,1:4]) # xo contains a unit from one group, as for example group 1. x0 <- c(5.3, 3.6, 1.1, 0.1) # distances between x0 and the other units. dx0 <- rep(0,150) for (i in 1:150){ dif <-x0-iris[i,1:4] dx0[i] <- sqrt(sum(dif*dif)) } proxi(d, dx0, iris[,5]) # xo contains a unit from one group, as for example group 2. x0 <- c(6.4, 3.0, 4.8, 1.3) # distances between x0 and the other units. dx0 <- rep(0,150) for (i in 1:150){ dif <-x0-iris[i,1:4] dx0[i] <- sqrt(sum(dif*dif)) } proxi(d, dx0, iris[,5])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.