gini()
calculates the Gini Index associated to the variable var
.
gini(var)
var
.
For each site, Gini.r returns two pairs of frequencies. The pair (f
,g
) where f represents
$$f_k=\frac{1}{n}\sum_i 1(Var_i=x_k)$$ (n is the length of var
) and g represents
$$g_k=\frac{x_k}{\bar{x}}f_k$$ The pair (F,G) represents the corresponding cumulative frequencies.
The Gini Index is calculated as :
$$I_G=\frac{1}{2\bar{x}}\sum_{i=1}^K\sum_{j=1}^K|x_i-x_j|$$
ginimap