Descriptive statistics are used to summarise and describe one or more variables in a sample of data. They do not draw conclusions about a larger population (this is covered in the Inferential statistics page). For example, statistics such as the mean (\(\bar{x}\)) and standard deviation (\(s\)) are often used to summarise and describe continuous variables.
Descriptive statistics can be used in different ways, including to summarise one variable at a time (univariate analysis), to analyse relationships between two variables (bivariate analysis) and to describe patterns across three or more variables (multivariate analysis, which is not covered here).
This page explains how to display data and how to use descriptive statistics to carry out univariate and bivariate analysis for both categorical and continuous data.
In brief, it covers the following:
One way to display data for a single categorical variable is by using a table, specifically a frequency distribution table. This table lists the different categories for a variable, along with the frequency (how often each category appears in the data) and usually the percentage for each category. Sometimes, cumulative percentages are also included. These show the total percentage up to and including each row of the table.
For example, a frequency distribution table could show the number and percentage of people in each marital status category in a sample of \(80\) people:

Another way to display categorical data for a single variable is with a column graph or bar chart. These use rectangles of equal width that do not touch, with each rectangle representing a category. Column graphs display the rectangles vertically, while bar charts display them horizontally. In both cases, the height or length of each rectangle shows the size of the category, usually as a count or percentage, making it easy to compare categories. For example:

Categorical data for a single variable can also be displayed in a pie chart, which shows how the whole sample is divided into different categories:

Descriptive statistics used to analyse a single categorical variable include frequencies, percentages, fractions, and relative frequencies (which are obtained by dividing the frequency by the sample size).
For example, the data for the marital status variable from the previous section can be described using key values such as:
If you would like to practise analysing data for a single categorical variable, have a go at the following activity.
Continuous data for a single variable can also be displayed in a frequency distribution table, but the data must first be grouped into bins (also known as class intervals). These bins should be chosen based on the data. In general, they should be the same size, and there should not be too many.
For example, the following table shows the frequency of ages in a sample of 80 people after they have been grouped into bins:

One of the most common graphs used to display continuous data is a histogram. Histograms have several key features:
Different histograms can be created for the same variable depending on the bin (class interval) width. For example, the first histogram below uses bins of width one, while the second uses the same bins as the frequency distribution table above. The software you use will usually choose the bin width for you, so this is not something to worry about too much. However, if you create your own histogram, you can choose the bin width based on how much detail you want to show:


Another graph used to display continuous data is a box plot (also called a box-and-whisker plot). This shows how the data is distributed. For example, a box plot for the Age variable is shown below. Click on the plus signs to explore its key features, some of which are explained in more detail in the next section.
Continuous data for a single variable is usually analysed using two types of descriptive statistics: measures of central tendency and measures of dispersion.
It is important to understand how to calculate and interpret these measures, and also when it is appropriate to use each one. This is explained in the following sections.
The most common measure of central tendency is the mean (also called the arithmetic average). It is calculated by adding all values and dividing by the number of values. The sample mean is written as \(\bar{x}\), and for a sample of size \(n\) it is calculated using the following formula (note that \(\sum\) represents the sum of all the values):
\[\bar{x} = \frac{\sum x}{n}\]For example, the mean of the following ages:
\[19, 25, 28, 28, 23, 15, 28, 22, 24, 21\]is:
\[\begin{aligned} \bar{x} &= \frac{19+25+28+28+23+15+28+22+24+21}{10} \\\ &= 23.3 \end{aligned}\]The mean is usually used for continuous data, but it may not be suitable if the data is skewed, contains outliers, or is censored (not fully observed). In these cases, the median is more appropriate. The median is the middle value of the data when it is arranged from smallest to largest. If there is an even number of values, it is the mean of the middle two values. For example, ordering the ages data gives:
\[15, 19, 21, 22, 23, 24, 25, 28, 28, 28\]and the median is then the mean of the middle two:
\[\frac{(23+24)}{2} = 23.5\]Finally, the mode is the most frequently occurring value (or values) in the data. If two or more values occur equally often, all of them are reported. The mode is not always near the centre of the data, so it is not always a measure of “central” location. However, it is useful when you want to know the most common value. For example, the mode of the ages data:
\[19, 25, 28, 28, 23, 15, 28, 22, 24, 21\]is \(28\).
The mode can also be used, and is more commonly used, for categorical data.
If you would like to test your understanding of the mean, median, and mode, have a go at one or both of the following activities.
The simplest measure of dispersion is the range, which is the difference between the smallest and the largest values in a data set. For example, the range of the ages in the previous section is \(13\) (that is, \(28 - 15\)). While the range is easy to calculate, it is limited because it only uses two values.
Another way to describe spread is by using percentiles. Percentiles show the position of a value within an ordered data set. They are useful for comparing a value to the rest of the sample. For example, if a child is in the \(97\)th percentile for height, this means the child is taller than \(97\%\) of others in the sample.
Because the sample of ages is small, it is useful for demonstrating percentiles. You can explore some examples in the diagram below:
A specific type of percentile is quartiles, which divide the data into four equal parts:
The quartiles for the age data are shown below:
The interquartile range (IQR) is the difference between the first and third quartiles. In this example, it is \(7\). The IQR is often used along with the median when the data is skewed or contains outliers.
In other situations, the mean and standard deviation are usually used together. The standard deviation describes how spread out the data is and takes into account all values in the sample. It is calculated by finding how far each value is from the mean, squaring these differences, adding them together, and dividing by one less than the sample size. This result is called the variance, and taking the square root of the variance gives the standard deviation, which is usually preferred because it is in the same units as the original data. The formula for the sample standard deviation (\(s\)) of a sample of size \(n\) is:
\[s =\sqrt{\frac{\sum(x - \bar{x})^2}{n - 1}}\]To calculate the standard deviation for the age data:
\[19, 25, 28, 28, 23, 15, 28, 22, 24, 21\]we first use the mean \(\bar{x} = 23.3\).
Next, subtract the mean from each value:
\[-4.3, 1.7, 4.7, 4.7, -0.3, -8.3, 4.7, -1.3, 0.7, -2.3\]Then square each result:
\[18.49, 2.89, 22.09, 22.09, 0.09, 68.89, 22.09, 1.69, 0.49, 5.29\]Add these values to get \(164.1\), divide by \(9 \) (that is, \(10 - 1\)) to get \(18.23\), and then take the square root to get a standard deviation of \(4.27\)
If you would like to practise these calculations and to practise deciding which measures to use, have a go at the following activities.
Measures of central tendency and dispersion can also be used to compare a continuous variable across different categories of a categorical variable. This is often done by comparing the mean values of different groups.
For example, if the first five people in our sample are female and the second five people are male, we can compare the mean age of the two groups:
\[\begin{aligned} \textrm{Ages of females} &= 19, 25, 28, 28, 23 & \textrm{Mean age of females} = & 24.6 \\\ \textrm{Ages of males} &= 15, 28, 22, 24, 21 & \textrm{Mean age of males} = & 22 \end{aligned}\]This tells us that the females in our sample are, on average, \(2.6\) years older than the males.
If you would like to practise comparing means, have a go at the following activity.
Cross-tabulations (also called contingency tables) are used to examine the relationship between two categorical variables in a sample. A cross-tabulation contains rows and columns that show the categories of the two variables being compared. Each cell in the table shows the frequency, or number of people, that fall into a particular combination of categories, and the table also includes subtotals for each row and column together with an overall total in the bottom-right corner.
For example, the following cross-tabulation displays data for two variables (gender and feelings towards statistics), for a fictional sample of 300 people:

Cross-tabulations often also include row percentages, column percentages and/or total percentages, depending on the purpose of the table. To learn more about these percentages, click the plus signs in the diagram below:
Data for two categorical variables can also be displayed using a clustered bar chart or a stacked bar chart. A clustered bar chart is useful for comparing the categories of one variable across the different categories of the other variable, while a stacked bar chart is more useful for comparing the overall totals for the categories of one variable.


Data in cross-tabulations can be analysed using the frequencies and percentages shown previously. In addition, expected frequencies can also be used to analyse the association between the variables in the sample. These frequencies are calculated based on the assumption that there is no association between the variables in the sample.
The expected frequencies can then be compared to the actual frequencies to test for association. If the actual frequencies are similar to the expected frequencies, this suggests that there may be little or no association between the variables. If the actual frequencies differ substantially from the expected frequencies, this suggests that an association may exist between the variables.
For some examples of how expected frequencies are calculated, and how they can be interpreted, click on the plus signs in the diagram below:
If you would like to practise interpreting cross-tabulations, have a go at one or both of the following activities.
The relationship (or lack of a relationship) between two continuous variables in a sample can be displayed using a scatterplot. This plots the values of the independent variable on the x-axis and the values of the dependent variable on the y-axis.
For example, the scatterplot below shows the ages and weights of a sample of 80 people. The data points do not closely follow a straight-line pattern, which suggests that there is a weak or no linear relationship between the two variables. It is important to note that two variables may still have a non-linear relationship, but non-linear relationships are not covered in this module.

When investigating linear relationships, a scatterplot can help you identify:
Finally, the strength and direction of a linear relationship (or lack of a relationship) between two continuous variables can be measured using Pearson’s correlation coefficient (\(r\)).
The correlation coefficient is a number between \(-1\) and \(1\). Positive values indicate a positive linear relationship, while negative values indicate a negative linear relationship.
In general:
For example, suppose two variables contain data on age and scores on a memory test. If the correlation coefficient (\(r\)) is \(-.72\), this indicates a strong negative linear relationship between the variables.
If you would like to practise interpreting a correlation coefficient together with a scatterplot, have a go at the following activity.