Grouping data by minimizing the within-group sum of squared deviations

按组内离差平方和最小分组

How do you group data by minimising within-group variation?

Sort the data; try every split point; and keep the one whose within-group squared deviations sum to the least.

SkillKP004390

Sign in to read the whole lesson, with 28 exercises

Sign in / Sign up

Mastery goals

  • Can split sorted data into two groups, find the within-group sum of squared deviations for each way of splitting and choose the smallest
  • Can explain that the smallest within-group sum of squared deviations gives the largest difference between groups
  • Can split data into three groups in the same way

Sorting things into groups is common in everyday life. Supermarkets shelve goods by use, hotels are rated in stars by their facilities and service, and so on. When we face many different objects, grouping them often makes a problem easier. For a data set with many different values, grouping the data sensibly can also help us solve a problem.

Problem A club wants to pick some of its entrants for the final. All entrants first take part in a preliminary round, and the results decide who goes through. The preliminary scores (out of ) of entrants, arranged from smallest to largest, are:

Which entrants do you think should go through to the final?

Naturally, those with good preliminary scores should go through. But what counts as a good score? There are different standards, for example "the top three" or " and above". Whichever standard is used, the aim is to split the scores into a good group and a weak group.

These standards each make sense and are often used in practice, but none of them takes the features of the data into account, so two very close scores may land in different groups. For example, and differ by only mark, yet if the standard is "the top three", goes through to the final and does not. From the club's point of view, putting relatively close scores in the same group is more reasonable. So we can group the data by the principle of the smallest difference within groups.

Arrange the scores from smallest to largest, so that the closest scores sit next to each other. To make the difference within groups as small as possible, we only need to look for ways to cut the sorted data. The scores form gaps, and each gap can split the scores into a good group and a weak group, so there are ways to split.

Number line55606570758085909510062667073788188899195
The scores in order; between neighbouring scores there are gaps in all.

Example 1

The mean temperatures (in ℃) of cities in one month are shown in the table.

CityABCDEFGHIJ
Temp/℃

Using the principle of the smallest within-group sum of squares, split the cities into two groups.

Solution: Arrange the data from smallest to largest:

There are ways to split them into two groups. With a calculator or a technology tool, work out the within-group sum of squares for each (correct to one decimal place), as in the table below.

SplitFirst groupSecond groupWithin-group sum
Gap 1
Gap 2
Gap 3
Gap 4
Gap 5
Gap 6
Gap 7
Gap 8
Gap 9

Looking at the last column, the within-group sum of squares is smallest when we split at gap . So the best split is

that is, cities G, B, D form one group and cities J, C, F, A, I, H, E form the other.

Summary

Faced with a heap of messy data, we must organise and analyse it carefully to get useful information. Tables and statistical charts let us see the features and patterns of the data directly and show where to look next; but to state the features precisely we must pick different statistics for different features: central tendency can be described by the mean, median and mode, spread by the sum of squared deviations and the variance, and the rough shape of the distribution by the quartiles, and so on. Even statistics for the same feature each have strengths and weaknesses, so the choice depends on the problem. Data can be grouped by closeness on different principles, and a different principle may give a different result; the smallest within-group sum of squares is one common principle. Learning all this strengthens our sense of data.

One basic idea of statistics, and one of its main aims, is to estimate a population from a sample: a statistic of the sample estimates the matching statistic of the population. For example, the sample mean and variance estimate the population mean and variance, and so tell us the average level and the spread of the population.

Analysing dataCentral tendencymean; weighted mean: a weight shows importance or frequencymedian: the middle after sorting; mode: the most frequentchoose the statistic that suits the problemSpreadsum of squared deviations, variance: smaller means steadierDistributionquartiles Q₁, Q₂, Q₃boxplot: smallest, Q₁, Q₂, Q₃, largestGroupingsort, cut between neighbours; smallest within-group sum of squaresSample and populationsample mean and variance estimate those of the population
The structure of this chapter.

Review the whole chapter with these questions in mind:

  1. What are the strengths of the mean, median and mode in describing the central tendency of data?
  2. How are the mean and the weighted mean related and how do they differ? Give an example to show the role of the "weight" in a weighted mean.
  3. What are the strengths of the sum of squared deviations and of the variance in describing spread?
  4. Why can the quartiles and the boxplot help us see roughly how data are distributed?
  5. Besides grouping by the smallest within-group sum of squares, can you think of other principles for grouping data?
  6. Collect material on statistics (for example its history, its ways of thinking, or people in the field), pick an angle of your own and say what you think of statistics.

Related points

All points in this topic

Cite this page: Grouping data by minimizing the within-group sum of squared deviations · KnowledgeTree (知识树), https://www.knowledgetree.world/en/kp/KP004390