Ten days of statistics (1) - Mean, Median, Mode
Mean
The average of all the integers in a set of values. Formally:
Where is the element of the set
Weighted mean
Given a discrete set of numbers , and a corresponding set of weights , the weighted mean is calculated as follows:
Where , is the value and weight for element of the set
Median
The midpoint value of a data set for which an equal number of samples are less than and greater than the value.
For an odd sample size, this is the middle element of the sorted sample
For an even sample size, this is the average of the 2 middle elements of the sorted sample
Mode
The element(s) that occur most frequently in a data set. For the set , the mode is . For the set , every number in the set is a valid mode.
Application of mean, median and mode
Mean
Human Resource managers often calculate the mean salary of individuals in a certain rank so they can know how much salary to offer to new employees.
Median
Human Resource managers also often calculate the median salary so that they can be informed of what the typical “middle” salary is for a particular rank. Median is less influenced by outliers (few extraordinary talented individuals with super high salary) so it is sometimes more accurate than mean value.
Mode
Real estate agents often calculate the mode number of bedrooms per house, so they can inform their clients on how many bedrooms they can expect to have in houses in a particular area.
Practice
Hackerrank has some exercises for you to test your knowledge:
- https://www.hackerrank.com/challenges/s10-basic-statistics/problem
- https://www.hackerrank.com/challenges/s10-weighted-mean/problem
Next lesson: Quatiles, Standard Deviation