![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Non
Accounting Home
Page
Geometric Mean page
Means, Medians and Modes of Grouped Data
Arithmetic Mean page |
Measures of Central Tendency with some MS Excel Tips"h1"> The Median and the Mode Introduction Following on directly from the arithmetic and weighted means page, here we are now with a discussion of the median and the mode. Two alternative ways of measuring the average of a data set. The Median The median is defined as the mid point of the values in a data set after they have been ordered from the smallest to the largest. With the median, there are often no calculations to make: hurrah! All we need to do is to put the data set in order and then find the middle value. For example: find the median salary from the following monthly salary values for nine employees in my department:
All we have to do is to put these salaries in order starting with the smallest (1,200) and ending with the highest (3,500) and then find the middle (5th) salary value:
A neat trick to help you is to sort the data from smallest to largest, as we have done here; and THEN to sort the same data from largest to smallest; and THEN to put the two series next to each other and automatically the median is revealed! Take a look at what I mean:
You wouldn't need to use this trick with a small data set; but if you have many data points to consider this trick could be useful … especially if you are using a spreadsheet! Microsoft Excel's median function is =MEDIAN(range of data) and it doesn't matter whether you enter your data in order or randomly, Excel will sort it out. For example, assuming the data in the previous example were in the range A1:A9, enter =MEDIAN(A1:A9) in any cell outside the range A1:A9, press enter and hey presto all is revealed! The Median and Outliers The median can help with outliers. Remember the problem with outliers and the mean values is that they take all values into account. So, when there is an outlier, or very large or very small value, the mean is distorted. The median tends to overcome that problem. Take a look at this example:
In this case we have four values that are within Nevertheless, the median has returned a value of A Problem with the Median Did you spot anything problematic with the median? Wasn't it convenient that we had an odd number (nine) salary values and an odd number (five) of house prices! Suppose that we had ten salary values, how would we have calculated the median then? Not sure what I'm on about? Well, try finding the median (the middle value) for the following rates of return that are already sorted for us:
Not so easy is it? There isn't a middle value because we have an even number of rates of return. The median, in fact, is somewhere between the third and the fourth values: between 22.6% and 25.4% and we find it by taking the arithmetic mean of these two values: the median is 24.0%. How does Microsoft Excel cope with an even number of data points? Have a go! Enter the table of rates of return in your Excel spreadsheet, enter the MEDIAN function and see what happens! Another point worth making about Excel's MEDIAN function is that we can use it to find the median of all of the data set or parts of it: that might be useful. Excel's Help file has a simple example of how to do this. The Mode The mode is the value that appears most frequently. That's it! So, in a medium to large sized data set, a number could easily appear several times and the number that appears most frequently is the mode, or modal value. To find the mode, take your data and put it into ascending order then check off which number appears the most. Here is a list of 15 numbers from 5 to 15 that have been drawn at random. Let's find the modal value.
So, the modal value is 13 because it appears 5 times in the list whereas the others appear only once, or twice or three times … Microsoft Excel can help us to take a look at the median very simply: a graphic that's not a graphic, by using the REPT function. Here is what it can look like:
The left hand column in the table above shows the frequency of a set of numbers in a data set. I set up the REPT function in the right hand column of the table as follows: =REPT("|";C1) where REPT means repeat or redraw a number, letter or symbol
Then copy the function down as usual and hey presto, you have a graphical/histogram type view of your data. Please note, because we are dealing with small data sets, the examples here shouldn't be difficult to deal with. However, if we were to deal with, say, finding the mode of 100 or 1000 numbers, we would be wise to use Excel's Tools/Data Analysis/Histogram function to prepare the table we need to use the REPT function. See Excel's Help files for help on the Histogram function. Microsoft Excel also has a MODE function that is as simple to use as the MEDIAN function. The MODE function is =MODE(range of data). Use Excel's MODE function to find the modal value of the following data set. If you feel confident, why not use the REPT function too and prepare your own graphical view of the data ... you should use the Tools/Data Analysis/Histogram function to help you here. As in the examples of =AVERAGE(range of data), use the MODE function in the same way. For you to do: work out the mode from the data in the table that follows and then create a histogram using the REPT function.
All being well, you will have found the following:
Now you have a choice: Go to the Geometric Mean page Work through the Means, Medians and Modes of Grouped Data Go to the Arithmetic Mean page Duncan Williamson
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
© Webmaster Duncan Williamson 2002 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||