Showing posts with label central tendency. Show all posts
Showing posts with label central tendency. Show all posts

Saturday, September 8, 2012

Percentiles, Quartiles, and Measuring Spread - Statistics


I recently explained several math concepts relating to the measurement of the center of data.  I explained the differences and how to obtain the mean, median, and mode for a set of data. While these statistical functions are indispensable when assessing how a data set is centered, they tell you nothing about how that data is spread out, or the variability.  To get this information, percentiles and quartiles are frequently used to supplement what you have determined about the center.

To better understand why knowledge about your data's center isn't sufficient, and why we need to know about the spread of the data as well, consider this point.  If you have a data set A composed of values 36, 38, 40, 42, 44, you can easily determine that the mean (center) of this set is 40.  Now consider a data set B that has the values 0, 20, 40, 60, 80.  This set also has mean of 40.  However, even though these two data sets have the same center, they are obviously very different!  Set A has a much tighter and narrower distribution, whereas set B has a much broader range.  This is where an analysis of the spread of the data is important to better understand your distribution of data.  Having information about both center and variability of your data distribution is one of the simplest and most useful analysis there is.

To start this discussion, I will begin with where we have already been: the median.  I explained that the median is the midpoint of your ordered data set.  So, 50% of your data points are below your median, and 50% is above it.  Now, from here, let me introduce the concept of quartiles first.  Personally, when I think of quartiles, I think of quarters immediately.  If a median is at the point representing 50% of the way through your data, the quartiles represent the points that are quarters through your set, or (roughly) every 25%.  So, the first quartile (called Q1) is at the point 25% of the way along your ordered set of data points (or, it is larger than 25% of the data, but still smaller than 75%).  It is better to say this is the median of the data on the left side of your overall median.  On the other end of your data is the third quartile (Q3), representing the 75% mark of your data, where it is larger than 75% of your group but 25% is greater still.  Similarly, you would find this by finding the median of the data that is to the right of the overall median.  And for those astute enough to catch that I skipped over the second quartile, it is true that the second quartile is the same as the median (M), at the 50% mark.  So, from this, you can hopefully already see that you can get a good idea of the spread of your data with this brief analysis.  (Technically, I refer to these points as 25% and 75% marks, though I recognize that these are approximations.  It is more appropriate to think of them as medians of each half of the data, and if you do the math to say they are the x-th value out of n-values, you will find that they are around 25 or 75, but likely not exactly.  I say this here not to confuse you, but because I'm sure some of my readers will point it out to me!)

In many cases, to get a good overall view of your data, you can report the mean of your data alongside the first and third quartiles.  In addition to this, it is also good practice to report the lowest and highest (extreme) data points.

With this information, you can construct a box plot (also known as a box and whiskers plot) that conveys all of this information visually, at a glance.  Box plots are extremely helpful, especially when you can present data sets side by side for easy visual comparison.  A box plot has a mark to denote the median, inside a box that represents the range from the first to third quartile.  You can alternately think of it as being a box of the quartiles, with one edge on the first quartile, the other edge on the third quartile, and a line inside the box to denote the second quartile.  Extending past the edges are lines that end on the extreme values.  Think of the box are representing the bulk of your data (more technically, the middle 50% of your data), which is why it's thicker, and the lines on the ends represent only a thinner amount of your data, or the tails of your distribution.

Follow along below to see an example of what a box and whisker plot looks like.  This hopefully demonstrates all that I've talked about above.  Note that the center, quartiles, and extremes are all easily seen on the box plot graph, and how easy they are to compare when presented like this.  

Consider the following two data sets, and then follow along with the analysis:
Set A: 32, 5, 8, 12, 2, 6, 2, 35, 32, 15, 18, 25, 22
Set B: 33, 1, 8, 33, 32, 26, 1, 18, 1, 30, 28, 29

The first thing you have to do for this statistical analysis is arrange the data from lowest to highest.

Set A: 2, 2, 5, 6, 8, 12, 15, 18, 22, 25, 32, 35
Set B: 1, 1, 1, 8, 18, 26, 28, 29, 30, 32, 33, 33

Now, you can just count off the important points.  Here, we have a relatively small number of points in each set, so it is easy to find these important marks.  I will colour them below:

Set A: 2, 2, 5, 6, 8, 12, 15, 18, 22, 25, 32
Set B: 1, 1, 1, 8, 18, 26, 28, 29, 32, 33, 33

It is a good method to draw yourself a number line, and then use it to construct your box and whiskers right above it once you've identified your important points. Here is how you could progress through the creation of this plot, along with the final result.


As you can see, you can gain a lot of information about your distributions very quickly!  You can see that Set A has a lower center, and a narrower spread (less variability).  Compare this to Set B, which has a higher center and a much broader range.  Note that the extremes are very similar in each case, so despite having similar ranges, these distributions are quite different.  One is smaller and tighter, the other is higher but broader.  Hopefully that explains quartiles for you!

Now I will briefly extend this concept to percentiles.  Technically, quartiles are only a subset of the percentiles. They represent the 25%, 50%, and 75% (roughly) marks of your set.  Percentiles, on the other hand, can represent any position in your data.  You can talk about the 95th percentile, which indicates the point that is greater than 95% of the rest of your data, or the 7th percentile where it is greater than only 7% of your data (and through induction, smaller than 93% of your data!).  You just have to determine which of your data points represents the percentage you want, and you have it!  If you compare this to how I explained the quartiles above, you can see that it is the exact same concept applied to any point that you want!  The quartiles have a special name simply because they have historically been used the most often.

So, with that information, you hopefully can now understand the importance of measuring the variability of your data in addition to measuring its center.  You can gain a lot of useful information from this simple data analysis, and it provides a great place to start when you are performing any amount of statistical analysis on a distribution of data.

In my next post, I would like to extend my discussion of data variability of data to include one of the most well known statistical functions: the standard deviation!


Sunday, August 26, 2012

Central Tendency - Statistics


In this first post of my new Statistics series of posts, it is going to be a refresh of the most common statistics you have ever done (and perhaps didn't realize were actually statistics): measures of central tendency.  I've previously done posts that briefly described the functions that measure center (e.g mean, median, mode), but here I am going to compile them all together in one place, and provide perhaps a better explanation of these statistics concepts.

Mean

The first statistic that I include here is the most common statistic with which you have likely ever worked.  You probably know it be the name "average" but in the field of statistics, you will find it referred to by "mean," "arithmetic mean," or "arithmetic average."  It probably doesn't need much of an explanation, as most students learn how to calculate averages very early on in school!  It represents a calculated measure of the center of a distribution of values, simply obtained by adding up all of the values and then dividing that sum by the number of values you added together.  (It is important to be aware that there are different types of means in statistics: sample and population means. I describe these in more detail in a separate post.  For the sake of demonstration, consider the math in this post to describe samples instead of populations.)

There are a couple of important points to make about the notation involved in calculating means.  The first is regarding the actual mathematical symbol for mean (because you don't want to always have to write down the word "mean" in your solutions!).  The symbol for mean is written as an x (or whatever variable you are using) with a small horizontal bar over it, like this:


You say this symbol as "x bar."  You can use and will see this notation wherever an arithmetic mean value is being used in statistical analysis and calculations.  It is extraordinarily common, yet would appear confusing at first to a student who is new to statistics, because it looks like nothing they had ever dealt with before.

In addition to this, there is a second notation that you will see that may need an explanation first.  This notation is used to describe the arithmetic mean formula.  I explained the concept and process of calculating a mean above, but here is one way in which you could write this down in your work:


Mathematically, this simply says that the mean is equal to the sum of all your values (x1 all the way up to xwhatever) divided by the total number of values that you are adding up.  This average formula could also be represented in another way, like this:


This formula for mean is saying the same thing as the previous one.  The 1/n part is the same in both equations (in the first, dividing by n is the same as multiplying by 1/n).  The fancy capital E-looking thing is the Greek capital letter sigma (which is not equivalent to E, but rather to S), and in math, it means to "sum up everything in the following equation."  And the xi part represents all the values of x.  So the sigma would start with x1, then add x2, then add x3, and so on, for all the values of x.  (I will do a separate post on sigma notation to perhaps explain this a bit better, with more examples.)

An important concept to understand about the mean is just what exactly it represents, and how it can be influenced by its dataset.  For a collection of values that are similar, the mean will provide a fairly reasonable measure of the center of this data.  However, if you consider the inclusion of any extreme values, you can see how this would cause the arithmetic average to be biased in its direction.  The more extreme the outliers are, the greater their effect on the mean.  Try for yourself to see what I mean.  Consider the dataset of values 1, 2, 3, 4, 5, and then consider the dataset of 1, 2, 3, 4, 20.  You can see that the mean is pulled in the direction of the outlier.  This is simply a result of how the mean is calculated, and is one of the flaws of it as a statistical tool.  Similarly, if have a distribution of values in your dataset that are "skewed" (that is, if you graph them out, you will see that the graph isn't symmetrical, and it has a tail on one end), the long tail will tend to bias the measurement of the mean in its direction.  Because of these characteristics, the mean is considered not to be a resistant measure (in that it can't resist being pulled by extreme data).  However, despite these points, the mean is an incredibly useful tool for statistics, if for no other reason that it is so simple to use, and provides a very quick evaluation of how the dataset is centered.

Median

The median is a second of the three measures of center that I want to talk about here.  Conceptually, I think that it is probably even simpler to understand than the mean.  It's much easier to calculate.  Whereas the arithmetic mean requires you to perform the calculation I described above (or really keen people know how to use their calculator's mean calculation function!), to determine the median, you don't have to do any mathematic operations at all!  Quite basically, the median represents the midpoint of your dataset, the point where half of the data is larger and the other half is smaller.  You don't have to calculate it, you just have to identify it.

To do this, all you need to do is take your dataset, and arrange all of the values in increasing size.  The value in the center is your median, often represented by the capital letter M.  When you have an odd number of values in your dataset, you will be able to find the median very easily.  You can identify it through a quick calculation to find which is the center value, which is simply the (n+1)/2 value in your order, where n is the total number of values in your dataset.  Note that this median formula only tells you where in the order your median is located, not the value of the median.  If you have an even number of values, then your median is represented by the mean of the two center values (using the same calculation above to determine the location, you'll result in a location 4.5 for example, indicating that the median is the mean of the values at locations 4 and 5).  So, in this case, your median does not necessarily have to be one of your data points, but instead the average of the middle two.

Determining the median can be a very tedious process if you have a very large dataset.  In these cases, the use of a spreadsheet software will come in extremely handy!  Then, you can automatically sort your values, and then identify the one(s) you require.  For small data sets, on the other hand, it takes very little effort to sort through and rearrange the values, making the median another very simple and useful statistical tool to evaluate central tendency.

There are a few differences to consider when comparing the mean and the median.  Since the mean uses the actual data values in its calculation, it is influenced more by extreme or skewed data.  Therefore, the median will represent a better estimate of the center of the distribution.  In this sense, the median can be considered to be a more resistant measure than the mean.  So, if you have a symmetric distribution of data, the mean and the median will be very similar.  However, when you have skewed distributions, the mean will be located more in the long tail of the distribution, further away from the median.  Consider, if you have a set of prices in a data set, and then you double the highest price, the median will be the same in both cases, though the doubled price point will push the mean much further away and more towards that extreme end of the distribution.  The mean and the median provide differing assessments of the central tendency of a distribution, but both functions are extremely useful in statistical analysis.

Mode

The mode is the third statistical function used to evaluate the center of a dataset.  It is just as easy to determine as the median.  Once again, there is no mathematic operation needed to determine the mode.  That is because the mode is quite simply the value that is most common in your dataset.  If you have arranged all of your data points in increasing order to assess the median, as described above, then it is quite easy to find the mode.  For example, in the dataset 1, 2, 3, 4, 4, 4, 5, the mode is 4 because it is repeated the most often.  See?  Easy!  

There are two points to keep in mind: for one, you can have more than one mode (if you have a dataset of 1, 2, 2, 3, 4, 4, then you have two modes, 2 and 4); and second, if no term is repeated at all, then there is no mode to the dataset.  

It is also good to know that of these three statistical functions I've covered already, the mode is the only stat that can be applied to non-numerical datasets.  For example, the mode could be used to say what colour shirt is the most commonly worn shirt in an office.  The dataset for this could read like: red, white, blue, green, blue, yellow, blue, blue, red, black, and so the mode is blue.  You can't arrange these in increasing size to find a median.  You cannot apply the mean formula.  These concepts don't make any sense when you consider this data!  However, the mode makes perfect sense and is very easy to determine.



Range

While we're considering these methods of measuring central tendency, it would also be useful to mention range.  Technically, range doesn't provide any sense of measure of center.  However, it is very useful in evaluating the spread of the data, or how close the values are to the distribution's center.  Range is another simple concept, but it may not be exactly what you would think it should be.  If you have a dataset, or a graph of a distribution, you would be incorrect to say that the range is the low value to the high value.  (This would be similar to the definition of range in graphing, where range is all the y-values on the curve.)  However, range is slightly different in statistics.  Range is the DIFFERENCE between the high and low values of your dataset.  So, for the dataset 5, 6, 7, 10, 13, the range is 13-5, which is 8 (not 5 to 13, as may be thinking).

So, that is mean, median, mode, and range.  These are some of the most basic and common statistical operations that you will encounter.  Quite likely, you have already used some of these before, and may not have realized that you were actually doing statistical analysis of a dataset.  They are all different, and so they provide different assessments of how your data behaves.  They are all useful in their own way, and each shows strength in analyzing different types of data.  Therefore, it is extremely important that you learn what each stat means, and how to evaluate them.

I hope that this post has been informative and helpful for you!  If it was, please don't forget to hit the +1 button below, or click here to share by tweeting about it!


Monday, August 20, 2012

A New School Year is Coming...


With the new school year rapidly approaching (again), I am thinking that it might be a good time to (once again) (try to) begin a cohesive series of posts to discuss a particular unit.  I have been finding that a lot of my readers actually arrive on my site through various searches of statistical functions and concepts.  I have previously introduced the concepts of mean, median, and mode, and provided a brief discussion about these measures of central tendency, and the situations in which you would use each function.  But I think it might be useful to several of my visitors to provide more than just these brief introductions.

Admittedly, I do not have a statistics background.  I am much stronger in the various mathematics concepts that I have already covered on my site (e.g. algebra and calculus), and I only ever studied basic stats and probability in university.  However, if you consider that I will be explaining these functions essentially as I am learning them, hopefully my explanations will be at the perfect level for others who are just learning them as well.  It will be like a study group where we learn together, and can discuss ideas back and forth so that everyone can benefit.  I welcome, appreciate, and encourage feedback on all of my posts, and I can say that I hope to get even more feedback about the coming posts.  I might also add that I am open to considering guest posts by other math writers, maybe from those who know the subject of statistics better than I do!  If anyone is interested, please don't hesitate to contact me to discuss.

My posts will start shortly, as I find available time to put them together.  These may take more time to prepare than I usually require, so please have patience, and come back soon.  Hopefully, I'll be able to put together a nice package to get Statistics Explained for you!


Friday, February 26, 2010

Which Measure of Central Tendency to Use? Mode, Mean, or Median?


A concept which may need a bit more explanation is: which average is appropriate for a given question? What is the best measure of central tendency? When would you use a median instead of a mean, or perhaps use a mode instead?

For any data set, you can perform the analysis to come up with a value for each average. However, here are a few basic guidelines to help you choose the most appropriate form of central tendency to describe your data.  If this is helpful, it would be great if you could please hit the +1 button to share it!

1. For a normal, random distribution of data (evenly distributed), the mean is preferred.
2. For a skewed data set, a median is more appropriate than a mean. The skewed data set (ie. extreme data points) will cause the mean value to be much more extreme than the median, and therefore less central.
3. The mode can be used for non-numerical data. Eg. hair colour in a classroom.

Here are a few examples of where each would be appropriate:

Mean:
1) students' heights in a classroom
2) temperature over a length of time

Median:
1) income of a group of people
2) test scores for a group of students

Mode:
1) finding the most common hair colour in a room
2) finding the most common car in a parking lot

Hopefully these guidelines will help you to determine which is the most appropriate measure of central tendency to report for your data set.

Again, if this was helpful, please share and hit the +1 for me! :)


Sunday, July 26, 2009

Introduction to Statistics - Mode


The third concept of introductory statistics that I will explain here is the mode. (Refer to my previous posts about mean and median.)

The mode is also a measure of average (central tendency), but again, different from how you have likely thought of an average before.

The mode is simply the value in a data set that is represented the most times.

Again, let's refer to my ongoing test grade example:

Example:
The grades received for a test in a math class, composed of 13 students, were:
65, 98, 92, 43, 76, 64, 69, 72, 75, 85, 96, 90, 90

When you rearrange them from lowest to highest, you can quickly identify which value appears the most times:
43, 64, 65, 69, 72, 75, 76, 85, 90, 90, 92, 96, 98

So, for this data set of math scores, the mode was 90... that is, more students scored 90 than any other single grade achieved.

Hopefully this series of posts has helped to explain the calculation of median, mean, and mode. As you will see in your studies, each has its own applications and are useful in their own ways. It is important to realize though that they are all related as forms of average, and they all describe the centeredness of a data set. See my post here for tips on how to choose which of these measures of central tendency to use.

As always, leave a comment if you need clarification or more information on the topics I've posted. As well, as I have done with this series of posts, I will try to address any requests students may have as well in future posts. :)


Introduction to Statistics - Median


The next introductory statistical concept I will discuss is the median. It is similar to the mean in that it is a form of an average, or a measure of central tendency, though most likely not in the terms that you have thought of an average before.

While the mean is the sum of a group of values divided by the number of values, the median is the point at which half of the data points of the set are below it, and half of the data points are above it. In other words, the median is the midpoint of the data set, with 50% of the data points on either side of it. As you will see, while this number CAN be equal to the mean, it does not have to be.

Let's continue with the example given in the post about means.

Example:
The grades received for a test in a math class, composed of 12 students, were:
65, 98, 92, 43, 76, 64, 69, 72, 75, 85, 96, 90
What is the median of this set of data?

The first thing to do is to rearrange the data points from lowest to highest.
43, 64, 65, 69, 72, 75, 76, 85, 90, 92, 96, 98

To determine the median, you simply have to pick out the MIDDLE value of this data set. For data sets with an odd number of values, this is easy. This data set, however, has 12 values, so the median is actually represented by the AVERAGE of the center TWO values. In this case, the middle 2 values are the 6th and 7th values, 75 and 76. Therefore, the median of this data set is the average of 75 and 76, which is 75.5

Let us pretend that one student was sick on test day, and when he took it later on, he scored a 90 on the exam. If we now factor this in, we have a data set of 13 values (an odd number), and so as you can see, the middle point is the 7th point, which is 76.

Also, convince yourself that that addition of this student's score increases the mean to 78%.

The final concept to discuss is the mode, which I will explain next. See my post here for tips on how to choose which of these measures of central tendency to use.


Introduction to Statistics - Mean


As I have received several requests to do so, I am going to put up a couple of posts that explain some basic statistical concepts. The first few will be the mean, median, and mode, the three most common measures of central tendency. Several students find these concepts difficult to grasp at first, but you will see that they are really quite simple. This post will explain the mean.

The mean may sound like a bad thing, but the mean is actually just another word for a concept that you have UNDOUBTEDLY used SEVERAL times up to this point... the AVERAGE! That's right, the mean is what you have always known as the average. (In fact, the average is not the most precise word to use to describe this function... mean is the correct name.) It is remarkable how many times this connection is not immediately presented to the students, and so they feel they are struggling with a new concept, and one that is probably not being taught well! I will briefly go over the calculation of the mean, but please leave a comment if you wish to have any additional details about it.

The arithmetic mean is the sum of a group of values, divided by the number of values used to determine that sum. A familiar example would go something like this:

Example:
The grades received for a test in a math class, composed of 12 students, were:
65, 98, 92, 43, 76, 64, 69, 72, 75, 85, 96, 90
What is the mean grade received on this test?

To compute the mean of this set of data, first determine the sum of the grades... this is 925.
Next, you determine the number of values, which was stated as 12.
Divide the sum by the number of values to give.... 77.083333
So the mean grade received on this test was 77%.

It's that simple. The sum of the values, divided by the number of values. :) Let me know if you want more. Otherwise, I will now move on to median and mode. See my post here for tips on how to choose which of these measures of central tendency to use.


Related Posts