Mean and median are both measures of central tendency in a set of data, but they represent central tendencies in different ways.
Mean
The mean is also known as the average, and the mean is calculated by adding up all the values in a data set and then divide by the number of values.
Median
The median is the middle value in a data set when it is ordered from least to greatest. If there is an even number of values, the median is the average of the two middle values. To find the median, you first arrange the data in ascending or descending order, and find the middle value.
Comparison
The mean is sensitive to extreme values (outliers) in the data, as it takes into account the magnitude of each value.
The median is less affected by outliers because it depends only on the position of values in the ordered list.
To give a real-life example of mean and median, let's take an example of household income in the USA. The median US household income in 2022 is $74,580 whereas the mean US household income in 2022 is $84,200. The mean value is affected by extremely high outlier values in high income families, while median is less affected by outliers. For this reason, the median value provides better insight of the typical household income in the USA.