Skip to content

Computer Science · Ch 7 — Understanding Data

Measures of Central Tendency

7.5.1

Measures of Central Tendency

A measure of central tendency is a single value that gives us some idea about the data. Instead of looking at every individual data value, we can calculate one of these measures to understand the average, the middle value, or the most frequent value in a dataset. The three most common measures are the mean, median, and mode. Which one to use depends on certain characteristics of the data.

(A) Mean

The mean is simply the average of the numeric values of an attribute. It is also called the average. For example, if we have data on the weight of 40 students in a class, instead of looking at each weight, we can calculate the average to get an idea about the typical weight of a student in that class.

Definition: Given n values x1,x2,x3,...,xnx_1, x_2, x_3, ..., x_n, the mean is computed as the sum of all values divided by n.

Example 7.1: The heights (in cm) of students in a class are: [90, 102, 110, 115, 85, 90, 100, 110, 110]. The mean or average height of the class is calculated by adding all these values and dividing by 9.

When is mean not suitable? Mean is not a suitable choice if there are outliers in the data. An outlier is an exceptionally large or small value compared to the other values in the data. Outliers can influence or affect the average and other statistical calculations. To calculate a meaningful mean, outliers or extreme values should be removed from the given data first, and then the mean of the remaining data should be calculated.

Note

Usually, outliers are considered as errors because they can significantly distort the average.

(B) Median

The median is also computed for a single attribute or variable at a time. When all the values are sorted in ascending or descending order, the middle value is called the median.

  • Odd number of values: If there is an odd number of values, the median is the value at the middle position.
  • Even number of values: If the list has an even number of values, the median is the average of the two middle values.

The median represents the central value at which the given data is equally divided into two parts.

Example 7.2: Consider the same height data used for the mean: [90, 102, 110, 115, 85, 90, 100, 110, 110]. To compute the median, the first step is to sort the data in ascending or descending order. Sorted in ascending order: [85, 90, 90, 100, 102, 110, 110, 110, 115]. Since there are 9 values (an odd number), the median is the value at position 5, which is 102 cm. This holds true whether you count from left to right or from right to left. The median represents the actual central value that splits the data into two equal halves.

(C) Mode …