Ten days of statistics (1) - Mean, Median, Mode
The average of all the integers in a set of values. Formally:
Where is the element of the set
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
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
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
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.
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.
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.
Hackerrank has some exercises for you to test your knowledge:
Next lesson: Quatiles, Standard Deviation