Login Register

Access the GIFSQ Portal

Select your user type to log in or register a new account.

Student Portal

Access your food safety courses and exams.

Instructor Portal

Manage courses, view student submissions, and grade quizzes.

Company Portal

Manage corporate setup, view employee logs, and access QA services.

Home / Resources / Tools Hub / Cluster Analysis Tool

Cluster Analysis Tool

Interactive Tool Free Resource

GIFSQ Tools · Module 16 — Statistics, Experimental Design & Research · Tool 315 of 500

Group observations into clusters with k-means: cluster sizes, centroids and the within-cluster sum of squares that measures how tight the grouping is.

Try sample values — fills the form with the worked example below.

–
Within-cluster SS
–
Cluster 1 size
–
Cluster 2 size
Equation: k-means (Lloyd’s algorithm): assign each point to the nearest centroid, then move each centroid to the mean of its points, and repeat until assignments stop changing. WCSS = Σ over clusters of Σ (point − centroid)².
Method: k-means clustering (MacQueen, 1967; Lloyd’s algorithm). Initial centroids are the first and last observations (and the middle observation for k = 3), so the result is deterministic — the same data always give the same clusters. At most 100 iterations.
Assumptions: the variables are on comparable scales (standardise first if not); clusters are roughly spherical and similar in size; k is chosen by the user, not by the tool.
Limitations: k-means can settle in a local optimum that depends on the starting centroids; with very different scales one variable dominates the distances. The tool does not choose k for you — compare WCSS across k values.
Rounding: centroids to 2 decimal places; WCSS to 4 decimal places; intermediates unrounded.
This is a calculation aid, not a laboratory report — confirm against your accredited method before citing a value.
Worked example: Points (1,1), (1.5,2), (2,1), (8,8), (8.5,9), (9,8) with k = 2: clusters of 3 and 3, centroids (1.50, 1.33) and (8.50, 8.33), WCSS = 2.3333.

Enter values above to see results.

Compare the WCSS for k = 1, 2 and 3: a sharp drop (the elbow) suggests the right number of clusters. Tool 315 of 500 — GIFSQ