Clustering big datasets with XLSTAT - Using k-means clustering followed by an AHC

Datensatz für Agglomeratives hierarchisches Clustering, k-means Clustering XLS289 KB

Videos für dieses Tutorial
Agglomeratives hierarchisches Clustering, k-means Clustering ist enthalten in: Download Demoversion Mehr Details Kommentare ansehen
  • Pro Statistische Kernsoftware

  • Voraussetzungen

    • Windows:
      • Versionen: 9x/Me/NT/2000/XP/Vista/Win 7
      • Excel: 97 oder höher
      • Prozessor: 32 oder 64 bit
      • Festplattenspeicher: 150 MB
    • Mac OS X:
      • OS: OS X
      • Excel: X, 2004 und 2011
      • Festplattenspeicher: 150 MB

Vorteile von XLSTAT

  • Praktisch und einfache Benutzung
    Praktisch und einfache Benutzung XLSTAT ist perfekt in Microsoft Excel integriert, das das am meisten benutzte Tabellenkalkulationsprogramm ist. Dank dieser Integration und der gleichen Philosophie wie Excel, ist die Benutzung von XLSTAT leicht. Die Software ist in einem speziellen Reiter verfügbar, der das Menu der XLSTAT-Module enthält. Die verfügbaren Analysen sind in Gruppen ähnlicher Funktion zusammengefasst. Die Dialogfenster sind einfach und Ihre Einstellungen verständlich.
  • Einfaches Mitteilen der Daten und Ergebnisse
    Einfaches Mitteilen der Daten und Ergebnisse Einer der größten Vorteile von XLSTAT ist die Tatsache, das die Daten und Ergebnisse ohne Einschränkung kommuniziert werden können. Denn die Daten und Ergebnisse werden in Microsoft Excel gespeichert und sind daher allen zugänglich. Eine XLSTAT Lizenz oder ein Programm zur Ansicht ist nicht erforderlich, um die Daten und Ergebnisse zu empfangen und anzusehen. Darüber hinaus sind die Ergebnisse leicht in andere Programme von Microsoft Office, wie PowerPoint kopierbar, was Ihnen das Erstellen von Präsentationen mit ausgezeichneten Diagrammen in wenigen Minuten erlaubt.
  • Modular
    Modular XLSTAT ist ein modulares Produkt um XLSTAT-Pro herum, das die Basissoftware von XLSTAT darstellt. XLSTAT-Pro schließt bereits alle verbreiteten statistischen Funktionen und multivariaten Datenanalysen ein. Die fortgeschrittenen Funktionen sind ebenfalls in zusätzlichen Modulen verfügbar, die speziellen Anforderungen gerecht werden. So können Sie Ihre Software an Ihre eigenen Anforderungen anpassen, was sie attraktiver werden lässt.
  • Didaktisch
    Didaktisch Die XLSTAT Ergebnisse sind nach Analysen aufgebaut und einfach durchzublättern. Darüber hinaus sind den Ergebnissen nützliche Informationen hinzugefügt, um die Interpretation zu erleichtern.
  • Preiswert
    Preiswert XLSTAT ist eine modulare, komplette Statistik- und Datenanalysesoftware, die sich an alle Ihre analytischen Anforderungen Ihrer Organisation anpasst. Der Preis ist sehr gering, was Ihnen eine quasi sofortige Amortisierung erlaubt. Alle XLSTAT Lizenzen schließen ein Support und eine Unterstützung hervorragender Qualität ein.
  • Zugänglich
    Zugänglich Wir setzen uns ein, XLSTAT so vielen Personen wie möglich durch eine Benutzerschnittstelle in vielen Sprachen darunter Deutsch, englisch, französisch, spanisch, italienisch, portugiesisch, polnisch, chinesisch und japanisch zugänglich zu machen.
  • Automatisierbar und personalisierbar
    Automatisierbar und personalisierbar Die Mehrzahl der in XLSTAT verfügbaren Funktionen können direkt aus Visual Basic for Applications von Microsoft Excel heraus aufgerufen werden. Sie können in Ihre Routinen integriert werden, um Ihren Anforderungen einer speziellen Anwendung gerecht zu werden. Das Hinzufügen von Ergebnistabellen, Diagrammen, oder das Verändern bereits existierender ist vereinfacht. Darüber hinaus schließt XLSTAT die Werkzeuge zur Erzeugen des VBA Kodes für die Dialogfenster ein, so dass Sie Ihre Analysen vom VBA Editor heraus einfach reproduzieren können, indem Sie die Einstellungen automatisch laden. Diese Automatisierung der Analysen wird Ihnen viel Zeit einsparen.

Dataset to cluster

An Excel sheet containing both the data and the results for use in this tutorial can be downloaded by clicking here.

The data are from the US Census Bureau and describe the changes in the population of 51 states between 2000 and 2001. The initial dataset has been transformed to rates per 1000 inhabitants, with the data for 2001 serving as the focus for the analysis. Our aim is to create homogeneous clusters of states based on the demographic data we have available. This dataset is not very big but it will illustrate how to deal with much bigger dataset.

Note: if you try to re-run the same analysis as described below on the same data, as the k-means method starts from randomly selected clusters, you may obtain different results from those listed hereunder. To fix the seed, go to the XLSTAT Options, Advanced tab, then check the "fix the seed" option.

Setting up the k-means clustering

Once XLSTAT is activated, select the XLSTAT / Analyzing data / k-means clustering command, or click on the corresponding button of the Analyzing data toolbar (see below).

barkmc.gif

Once you've clicked the button, the k-means clustering dialog box appears.

Select the data on the Excel sheet with the mouse. (Note: There are several ways of selecting data with XLSTAT - for further information, please check the tutorial on selecting data.) In this example, the data start from the first row, so it is quicker and easier to use the "column selection" mode. This explains why the letters corresponding to the columns are displayed in the selection boxes (C to H).

The Total population variable was not selected, as we are interested mainly in the demographic dynamics. The last column was not selected as it is fully correlated with the column preceding it. The observations labels were selected as they are available.

We set the number of groups to be created to 25. In the case of much bigger dataset you may use a bigger number.

The selected criterion is "Determinant(W)" as it allows to remove the scale effects of the variables.

statistical software

In the options tab we increased the number of repetitions to 50 in order to increase the quality and the stability of the results.

statistical software

In the Outputs tab we select only the Centroids which we will use in the AHC, the results by class as it will give us the samples within each class and the results by object to get the table of the sample with an attribution variable.

statistical software

Once you clicked on OK the results of the k-means clustering will appear in a new sheet.

Agglomerative Hierarchical Clustering on the results of the k-means clustering

We are going to work on the table Class centroids.

statistical software

Another important table is the table containing the information about which states are clustered together.

statistical software

Select now the XLSTAT / Analyzing data / Agglomerative Hierarchical Clustering command, or click on the corresponding button of the "Analyzing data" toolbar (see below).

statistical software

In the General tab you need to select the data to cluster. Select the original variables describing the 25 classes in the Class centroids.

We will use the Proximity type: Dissimilarities and the Euclidian distance, as well as the Ward’s method as the agglomeration method.

We have the name of the variables included in the selection so we tick the option Column labels and select the Row labels that are the cluster number (1-25).

We will use the Row weights option and select the column Sum of weights of the same table Class centroids.

statistical software

In the Options tab we confirm we want to cluster the rows as the classes are in rows but in this type of clustering (AHC after k-means) you need to include the Within-class variances. You will find this information in the same table as before: Class centroids, in the last column Within class variance.

statistical software

We can select all the Outputs for this analysis.

statistical software

Finally in the tab Charts, select all the charts. Pay special attention the the dendrogram type and select the option Vertical.

statistical software

Results of the Agglomerative Hierarchical Clustering

In the results of the AHC, look at the two dendrogams that give you the composition of the 3 clusters. You can see how the 25 clusters are clustered in three final clusters.

statistical software

Also you can see the decomposition of the variance.

statistical software

You can finally use the table obtained in the AHC to recode the table obtained in the k-means clustering so as to have the final results. Go to XLSTAT / Preparing data / Coding.

You need to select the column Class from the classification table obtained in the k-means clustering as the variable to recode. Select the table Result by object from the AHC including the name of the columns as the coding table. You then select the option Column labels.

To append the new column to the first table select the option Range and the first cell next to the table. Also untick the option Display report header so as to not have anything else displayed.

statistical software

Finally you obtained the results of the classification for the all the states.

statistical software

The following video shows how to do this tutorial. (This video does not have sound.)