distchi2 {GeoXp} | R Documentation |
The function distchi2
calculates an euclidian distance matrix for factors using metric of chi^2.
distchi2(mat)
mat |
A matrix of factors given as numeric values |
The euclidian distance between two individuals $i$ and $k$ using the metric of chi^2 is given by :
d^2_(chi^2)=n/p sum_j^p sum_l^m_j delta_ik^(jl) 1/n_l^j
with n, number of individuals, p number of variables, m_j is the number of possibilities for variable Y^j, n_l^j is the number of individuals where $l$ has been observed for Y^j and delta_ik^(jl)=1 if there is a discordance between $i$ and $k$ for $l$ and 0 otherwise. It is not an interactive function.
It returns a dist
object (see help(dist)).
Thibault LAURENT
Besse Philippe, Data mining 2 : Modélisation statistique et apprentissage.