Descriptive Statistics
By: Frank Ceballos
Tags: Math, Data Science, Statistics, Education, Mathematics

What are descriptive statistics?

The term descriptive statistics/summary statistics refers to a set of coefficients that help describe important characteristics of a sample. A typical sample can be represented by a list of numbers or categories, see Figure 1.

Figure 1 — A typical sample.

As the size of your sample increases, it becomes more difficult to understand — imagine having a sample that contains 1000s of numbers. Therefore, tools that concisely describe the information in a sample are needed. In this article, we will explain how to calculate the statistics that describe a sample; namely, the sample mean, sample standard deviation, sample variance, sample median, mode, range, and quartiles.

Definitions

Before we start is important to define several terms that will be used throughout this article.

A population is a complete collection of objects or measurements. For example, the entire human race would be consider a population. Another example would be all the possible voltage outcomes that might possibly be measured across a resistor using the same voltmeter. If you notice, a population can be real (something you can touch) or conceptual.

is a complete collection of objects or measurements. For example, the entire human race would be consider a population. Another example would be all the possible voltage outcomes that might possibly be measured across a resistor using the same voltmeter. If you notice, a population can be real (something you can touch) or conceptual. A sample is a subset of the population of size n.

Example 1: Suppose you wanted to measure mean height of data science students in you university. Here, the population would consist of all the data science students in the university and a sample would be all the data science students whose name begins with the letter F. Notice that there are different ways to select samples. In most cases, you should select your sample at random.

Example 2: Suppose that an engineer received a shipment of 1000 tires. He wants to determine the mean diameter of the population of tires; however, it would be time-consuming to go about measuring the diameter of 1000 tires. To describe the population of tires, the engineer should randomly select a sample of tires and compute its mean. We would refer to this as the sample mean since the mean would be computed from a sample and not using the population. It should be noted that the sample mean does necessarily equal the population mean but it should be close if the sample was correctly selected.

In this article, we will cover the definitions describing the sample statistics and won’t focus in population statistics.

The Sample Mean

The sample mean is most commonly known as the average — it gives you an idea of where the center of the data is. For a sample of size n the sample mean is computed by taking the sum of all the numbers in the sample and dividing it by n.

Suppose we have the following sample

17.82, 16.68, 16.89, 16.00, 18.68

of size 5. The sample mean would be computed as

The Sample Standard Deviation

Consider the following two samples and their distributions shown in Figure 2.

Figure 2 — Histogram of sample 1 and sample 2.

If you try to describe Sample 1 and Sample 2 only using the sample mean you might be incline to believe that both samples are similar since both have a similar sample mean around 50. However, we can see that the shape of Sample 1 (red histogram) is more heavily concentrated around 50 than the shape of Sample 2. This illustrates how the sample mean is not sufficient to describe a sample. Therefore, we can conclude that another important descriptor should be the spread of the elements in the sample.

The sample standard deviation is a measure of the spread of a sample with respect to its mean. A large sample standard deviation will indicate that the elements in a sample tend to be far from the sample mean and a small sample standard deviation will indicate that the elements in the sample tend to be close to the sample mean.

To calculate the sample standard deviation, we first compute the difference between each element in the sample with the sample mean, each difference is a deviation from the mean.

Since this difference can be negative we square them and add them all up.

Then we compute the average of the deviations.

To put it more concisely we write

This is quantity is also known as the sample variance. To obtain the sample standard deviation denoted by the letter “s” we take the square root of the sample variance.

Using the definition of the sample standard deviation we obtain

Sample 1 — sample standard deviation is close to 5

Sample 2 — sample standard deviation is close to 15

The Sample Median

The sample median, similar to the sample mean, is a measure that describes the center of a sample; however, in the presence of outliers, the sample median will represent the center of the sample more accurately than the sample mean.

Example: Determine the sample median of the following sample [24, 19, 23, 28, 31].

Solution: First we order the list from smallest to largest

[19, 23, 24, 28, 31]

Since the n = 5, an odd number, we can determine that the element in position 3 is the median. In this case, 23 is the sample median.

The Sample Mode

The sample mode is simply the element with the highest frequency in the sample.

Example: In a clinical study of diabetes, a sample of 10 men was taken from a large population. The number of times each man ate a day was recorded to be 1, 3, 4, 2, 2, 3, 3, 3, 2, and 2. Determine the mode of the sample.

Solution: Since the element that occurs the most (the one with the highest frequency) is 3 therefore 3 is the sample mode.

If two or more elements have the same high frequency, both elements would be considered the sample mode. Consider the following sample,

Sample: [2, 8, 6, 7, 8, 6]

In this case, the sample mode would be 6 and 8.

The Sample Range

The sample range is defined as the difference between the largest value and smallest value in the sample.

Figure 3 — Range of sample.

Quartiles

Quartiles divide the sample range into quarters as close as possible. To compute them by hand for a sample of size n use the following rules:

Order the elements in the sample in ascending order (smallest to largest). First Quartile: Find the element in position 0.25(n+1). If this is not an integer take the average value of the elements appearing on either side of this value. Second Quartile (same as Median): Find the element in position 0.5(n+1). If this is not an integer take the average value of the elements appearing on either side of this value. Third Quartile: Find the element in position 0.75(n+1). If this is not an integer take the average value of the elements appearing on either side of this value.

Example: Consider the following sample [15, 4, 6, 8 ,9, 7, 8, 10, 12, 14]. Compute the first, second, and third quartiles.

Solution: First we order the list:

[4, 6, 7, 8, 8, 9, 10, 12, 14, 15]

We know that n = 10 so let’s just use the definitions for quartiles shown above.

First Quartile: Compute the position 0.25(10+1) = 2.75. Since this is not an integer we will have to take the average of the values in position 2 and 3. Therefore, the average of 6 and 7 is 6.5

Second Quartile: Compute the position 0.5(10+1) = 5.5. Since this is not an integer we will have to take the average of the values in position 5 and 6. Therefore, the average of 8 and 9 is 8.5. This is the same as the median.

Third Quartile: Compute the position 0.75(10+1) = 8.25. Since this is not an integer we will have to take the average of the values in position 8 and 9. Therefore, the average of 12 and 14 is 13.

Figure 4— Quartiles.

Closing Remarks

Descriptive statistics are use to describe characteristics of the sample. They summarize several key aspects of a sample such as its central value, its spread, range, and the distribution of its elements. Until next time!