of objects in the group. This is the same criterion as used in Ward’s agglomerative
clustering.
4.8.1.1 k-means with Random Starts
If one has a pre-determined number of groups in mind, the recommended function to
use is kmeans() of the stats package. The analysis can be automatically
repeated a large number of times (argument nstart) using different random initial
configurations. The function finds the best solution (smallest SSE value) after
repeating the analysis ‘nstart’ times.
k-means is a linear method, i.e. it is not appropriate for raw species abundance
data with lots of zeros (see Sect. 3.2.2). One possibility is to use non-Euclidean
dissimilarity matrices, like the percentage difference (aka Bray-Curtis); such matrices should be square-root transformed and submitted to principal coordinate analysis
(PCoA, Sect. 5.5) in order to obtain a full representation of the objects in Euclidean
space. The resulting PCoA axes are then subjected to k-means partitioning. Another
solution is to pre-transform the species data. To remain coherent with the previous
sections, we can use the chord-transformed or “normalized” species data created in
Sect. 4.3.1. When applied in combination with the Euclidean distance implicit in kmeans, the analysis preserves the chord distance among sites. To compare with the
results of Ward’s clustering computed above, we ask for k ¼ 4 groups and compare
the outcome with the four groups derived from the Ward hierarchical clustering.
# k-means partitioning of the pre-transformed species data
# With 4 groups
spe.kmeans <- kmeans(spe.norm, centers = 4, nstart = 100)
spe.kmeans
Note: running the function again may produce slightly different results as each of
the ‘nstart’ runs starts with a different random configuration. In particular,
numbers given by the function to clusters are arbitrary!
# Comparison with the 4-group partition derived from
# Ward clustering
table(spe.kmeans$cluster, spech.ward.g)
spech.ward.g
1 2 3 4
1 0 0 0 3
2 11 1 0 0
3 0 0 8 0
4 0 6 0 0
4.8 Non-hierarchical Clustering
97
Précédent

- 110/444

Suivant