Central tendency & measure of dispersion of any populated data is important concept in statistics as most of the statistical techniques & assumptions for those methodologies are base upon them. The central tendency is a single number representation of all the data points gathered for a particular variable. While measure of dispersion suggest about the spread of these data points.
Let's understand these concepts & learn how to apply them.
Measure of Central Tendency: It is a measurement of a point in a data which is lying centrally to all the data points. This centrally located data point is a representation of all other data collected during a research study. This is also sometimes called as measure of central location or center of distribution of any data. Mean is the most frequently used 'measure' among others such as median and mode.
Although Mean, median and mode has their own properties & applications. If a data is normally distributed & follows all other assumption of a normal distribution, then all its central tendency coincides.
This is the right time to introduce very well known normal distribution "bell-shaped" curve. Although i will elaborate various types of distribution & their probability function in my forthcoming posts.
Now considering above distribution of Heights of Class-5 student, we can see that it seems normally distributed. By normally distributed, i mean the above distribution can be divided into 2 equal halves if we draw a line from center point. This centrally located data point is known as central tendency, & all measures of central tendency i.e. mean median or mode will be equal for such a data set. Although life is not that easy for a data scientist & data distribution can take any shapes.
We will describe the same in detail in our later posts.
Mean: it is generally referred to as arithmetic mean of the data, which is the sum of all the data points and divided by no. of observations. There are other types of means like harmonic mean or geometric mean, which are used alternatively for representation of the central tendencies of data.
Arithmetic mean can be calculated as
A.M. = (∑x )/N
Example: The monthly salary of employees of HR department are given below.
20, 25, 50, 42, 38, 35, 45, 25 (All fig. in '000)
Mean salary of employees can be calculated as,
=
20+25+50+42+38+35+45+25 8
= 35k
The above plot is for Employee Salary with respect to mean value. By this graph we can clearly see that employee 1,2,& 8 has less than average weight.
An outlier is a abruptly high or low values of data, which is recorded due to abnormal results, or human error. Mean is highly susceptible to the outliers. As a presence of outlier can pull the mean downward or upward from its true value.
Let's again consider salary of employees, but this time let's consider Salary of company director, which is 140k.
Mean salary of students = 20+25+50+42+38+35+45+25+140
9
= 46.67 k
After introduction of director's salary mean salary is increased by 30%. Is this new avg. salary is true representation of salary mean? Think about it. I will leave this topic with a thought of Outlier & its impact on mean in your mind. I will explain about outliers in forthcoming posts of Quintiles, boxplots and outliers.
Median: A median is a middle number, which is centrally located when all the data points are arranged in ascending or descending order. If no. of observation is odd it is obtained by adding 1 to total no. of observation divided by 2. While if observations are even it is no of observation divided by 2 th observation. For even no. of observation there are 2 medians. Remember the above calculations are the place of the data point which will be deemed as median and not median itself.
For odd no. observations median will be,
Median = (n + 1) th observation
2
For even no. observation median will be,
Median =
n th obs. +
n + 1 th obs.
2 2 2
Example: Again going back to the employee salary example.
20, 25, 50, 42, 38, 35, 45, 25, 140 (All fig. in '000)
Let's arrange them in ascending order.
20, 25, 25, 35, 38, 42, 45, 50, 140
no of data points = 9
median of observations = (9 + 1) = 5th obs. i.e. 38k
2
As you can see that, median has minimal impact of outliers and observed median is still close to the 'true mean' of employee salary, before introduction of outliers.
Mode: Mode is related to frequency of data points occurring in a data. It can be calculated as maximum no of times a data value is being observed. A series of numbers can have more than one mode. Such data is said to have multi-mode or multimodal data.
Mode is useful for data where we are having high repetitive values and values are in whole numbers. It is a frequency count of data. Data point with the higher frequency are going to be the modes.
Example: Take an example of weight of class-V students data, introduced in
earlier posts.
33 31 35 37 28 34 30 28 38 40 29 28 40 36 30 45 36 41 42 32 33 30 43 42 42 42 37 34 42 35
38 38 37 40 43 28 29 40 40 33 44 35 30 37 42 40 28 33 31 44 42 35 30 37 30 36 44 39 43 28
Below is the frequency bar chart of various weights.
Mode weight for student of class-V is 42 kg, its frequency in data is 7 counts. This data is uni-modal, as it has only one data value (42) which has highest frequency. Outliers have minimal or no impact on mode as it depends on the counts of the values in a data & by definition itself outliers are spikes or peaks which are 'rarely' observed, which in turn will generate less counts for them.
Measure of Dispersion: It is a measure of distribution and spread of data points. This measured value will give an idea about the distance of data points from the mean line or central tendency. There are different statistical measures like
1. Variance
2. Standard Deviation
3. Range
4. Inter-Quartile Range
5. Mean Absolute Deviation
We will discuss all of them in detail one by one, with example & contrast them based on their applications.
Variance: A variance is an average sum of squared difference of a data point from its mean. Now understand this! Why we need a square of difference? Why an average sum?.
OK! lets consider this we have a small sample data of heights of students of Class-V comprising of 10 observations. Lets tabulate this data & then find a mean & difference of mean with data points. A mean line is one which passes as the best fit line among all the data points. The distance between mean line and data points is referred to as error, & sum of all these errors is zero. This is the reason that we need to square the difference or errors. Taking an average of these sampled data gives us the variance.
Height (in cm) | mean | (x - mean) | (x - mean)2 | |
78 | 86.2 | -8.2 | 67.24 | |
78 | 86.2 | -8.2 | 67.24 | |
103 | 86.2 | 16.8 | 282.24 | |
71 | 86.2 | -15.2 | 231.04 | |
84 | 86.2 | -2.2 | 4.84 | |
104 | 86.2 | 17.8 | 316.84 | |
85 | 86.2 | -1.2 | 1.44 | |
103 | 86.2 | 16.8 | 282.24 | |
66 | 86.2 | -20.2 | 408.04 | |
90 | 86.2 | 3.80 | 14.44 | |
862 | 862 | -2.84E-14 | 1675.6 | |
Variance = ( sum of square of errors)
no. of observations. or
i.e., Variance for height of students = 1675.6 = 167.56
10
It is important to mention here that the distribution of all such samples' mean will also be normally distributed & the mean of the population can be estimated as mean of the sample mean distribution of all the samples given that population is normally distributed & its size is very large & we are going to draw an infinite no. of samples. As Variance is a function of sampled data, & hence for a normally distributed population, it is also distributed normally.
Large values of variance suggest that all observed data points are located far from mean line, & vice-versa in case of small variance for that particular variable.
Standard Deviation: Standard deviation is another measure of deviation of data from its mean. it is calculated as square root of variance.
Although when variance was sufficient enough, then why we need another measure. OK, let's take our previous example of height (measured in cm), If we calculate the unit for Variance it will be cm
2 . That means if a data deviated from mean by 2 units variance will be square of 2 i.e. 4 units ,which is unexpected, hence Standard deviation is introduced.
Standard deviation can be calculated as,
Range: Range for any series of data is defined as the difference of smallest & largest value in series. This is a simple but important statistic as it gives an idea about the spread of data on a linear scale. Range is highly susseptible to the outliers & can be mirepresentation of the spread of data.
Lets again go back to Employee salary example, used previously.
20, 25, 50, 42, 38, 35, 45, 25, 140 (All fig. in '000)Arrange all the salaries in ascending order on a number line.
Since director salary is more like an outlier for this series of data, we will remove it & range of the data is
R =
(50-20) = 30
Interquartile Range: An interquartile range is the difference of the 3rd Quartile & 1st Quartile. This takes care of very low or high values, which are treated as outliers. The 1st & 3rd Quartiles are defined as the 25th %ile value & 75th %ile value of the data. This range will basically consider the mid-50%ile of the range.
The Inter-Quartile Range (IQR) can be calculated as
IQR = (Q3 - Q1)
We generally plot this data in a boxplot in order to see outlier values. We will discuss Boxplots & outliers in our next post.
Mean absolute deviation: a mean absoulute deviation or MAD as it is abbreviated sometimes, is defined as the average of absolute distance of each data points from the mean. This is having the same unit as that of variable. This is also a measure of variability or spread of data values from data mean.