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_{chi^2}^2=frac{n}{p}sum_{j}psum_l^{m_j}delta_{ik}^{jl}frac{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'', Publication du LSP, http://www.lsp.ups-tlse.fr/Besse/