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, August 10, 2012

Negative Exponents and Reciprocals


So, I have taught you the trick to understanding negative exponents, and how you can use that information to more easily manipulate your expressions.  (In the same post, I also described how you can simplify your exponential equations wherever you see a base raised to a zero exponent.)  But I thought that I should maybe add a little bit more information to that, so that you can understand WHY an expression raised to a negative exponent is equal to its reciprocal base with a positive exponent, and not just simply know that it does.

My friend Guillermo has recently posted a similar topic on his Mathematics and Multimedia blog.

This concept is actually amazing simple.  At first, you might think that there is some long and calculated proof involved.  In actuality, this rule for working with negative exponents can easily be found merely by considering the Exponent Laws.  (You still remember them, right?  Refer back if you need a refresher!)  ;)

To keep things simple, I will provide a brief outline that will hopefully describe this concept sufficiently, though if not, I will defer you to Guillermo's page for more details.

Briefly, let's consider the general expression x-n.  This can be rewritten to show that the "-n" is being taken away from 0... this is always just assumed whenever we consider a negative number, but write it out this time.  So, now we have x0-n.  Now, using the Exponent Laws, we know that when we have a subtraction function in the exponent, this is the same as dividing the exponential terms (refer back to my Exponent Laws post, linked above!).  And having rearranged things now, you can call upon the property of the zero exponent (see link above!) to show that the numerator is simply just 1, leaving you with the reciprocal base of what we started with.  Those few short steps using the Exponent rules demonstrate how x-n is related to 1/xn.

Hopefully that quick walkthrough is a good enough guide to get you through those steps.  One thing to take away from this is just how important and useful the Exponent Laws are.  Make sure you understand them!


Thursday, June 28, 2012

Using Limits to Find Tangents


Having discussed in several posts the concept of limits in mathematics, in this post, I am going to describe a more practical use for limits so that you can see how useful they can be.  To do this, I would like to discuss tangents to curves (not to be confused with the tangent trigonometric function!).  You are probably already familiar with the concept of a tangent line, but here is a more descriptive definition of it:  a tangent can be defined as a line (or a three dimensional plane) that touches a curve (or a surface) at a single point, but does not intersect it or cross it.

Our problem, though, is how to express this line (let's stay away from the 3D surfaces and planes for now!) in terms of the math that we already know.  We can always draw an approximation of a tangent line to a curve, but how can we precisely define that line and express it in terms of an equation?  This is where limits come in!

Let's consider a basic example.  Consider the parabola described by the function f(x) = x2.  How can we describe the line that is tangent to the curve when x = 2?

Evaluating the tangent line to the parabola at the point (2,4)

Well, think about it this way.  How would you go about finding the equation of any other line?  It doesn't have to be a tangent or any other special line.  How would we find the equation of any line?  One of the first things that we'd need to know to write the equation of the line is the slope.  Now with that thought in mind, let's connect that to the concept of limits.

To find a slope of a line, we need two points and we calculate the slope m based on the differences in x and y values.  So, if we take any other point that lies on the curve, and we connect that point to the point where we want to evaluate the tangent line (here, at x=2), we would create a very rough approximation of our tangent line and can solve its slope knowing the coordinates of the two points.  (When we connect two points on a curve like this with a straight line, this line is referred to as a secant line.)  If we take points on the curve that are progressively closer and closer to our point of interest, the created secant lines more and more approximate the actual tangent line.  I've tried to demonstrate this in the following picture:  

Approximating the tangent slope by analyzing the slopes of secant lines

As you move along the curve from point A to B to C, the slope of the secant lines AP, BP, CP get closer and closer to the actual slope of the tangent at point P.  For good practice, try solving the equations of the lines for the 3 shown secants.  I have only plotted whole numbers, but you can better see the secant slopes approaching the tangent slope if you evaluate the lines formed by points even closer to P (try when x=1.9, then 1.99, then 1.999).  Once you can see what the slope of the tangent line will be, then it is only a matter of substituting that value, and the values of the ordered pair, into our favourite formula y=mx+b to solve for b, and then you can express the equation of the line in either standard form or point-slope form.  I have already done the work, and determined that the equation of the tangent line is y=4x-4.

So, hopefully you can see here the connection to limits!  As our extra points approach our point of interest, the slope of the secant approaches the slope of the tangent.  This is essentially what we do when we consider limits; that is, we are interested in what is happening as we get infinitely closer to our point of interest.  In this case, we can say that "the limit of m (slope), as x approaches 2, is 4."

With that, you can see that limits are not just some abstract mathematical concept designed to confuse students.  Limits actually can be useful, and in this case, we have seen that they can be used to determine the equation of a line at a single point!  

Please leave a comment if you would like a little more explanation or pointers.  Also, I'd appreciate anyone's input about my graphs... I am using a new program to draw them, and while I think they look good, I am still learning how it works.  And of course, please click the +1 below if you found this post helpful!  Thanks!


Saturday, June 23, 2012

Asymptotes


When working with mathematics concepts such as graphing and limits, you will soon encounter lines called asymptotes.  Despite many students' first thought being "that's a weird word!" they are really quite a simple concept to recognize.  In fact, you have probably drawn asymptotes before on your graphs and not even realized that you were using such a fancy mathematical concept.

An asymptote, quite simply, is basically any line (or maybe think of it as a border?) that your graph will approach and get infinitely close to, but never quite reach.  Now, stop and think about this for a minute, and realize how much in common this definition for an asymptotic line has with our definition of a limit which I introduced in a previous post (and then expanded on in the follow up post that discussed limit notation).  Conceptually, they both deal with your given function getting infinitely close to something, and the distance between a point on your graph and either your limit "a" value or asymptote getting infinitesimally smaller but never zero.  I should probably also emphasize this point, because it is not something to be taken for granted either.  Make sure you understand the connection between two things getting closer and closer together without ever touching, and so therefore the distance between the two things gets smaller and smaller without ever reaching zero.  Because if the distance between two points is zero, that implies that they are in the same place or touching, with no space between them to differentiate them.  This may seem like a simple concept, but I want to make sure that everyone understands it.  (For a different perspective, check out Guillermo's post on asymptotes and how they relate to curve sketching!)

So, that is how you could define an asymptote.  But, maybe you'd like to see a picture that more clearly demonstrates asymptotic behaviour of lines.  Let me try to demonstrate briefly with a few graphs:

This first graph is a common one, showing the graph of y = 1/x.

In the graph of y = 1/x, you can see that x never touches the line x = 0.  In this case, you would say that the line x = 0 is called a vertical asymptote.  Similarly for the y values, you can see that y never touches the line y = 0 either, so you would call this a horizontal asymptote.

When drawing graphs, you will often be asked to identify any vertical asymptotes or horizontal asymptotes.  Just make sure you don't mix them up!  :)

Let's look at another one, slightly different this time:

This is related to the first graph.  It is a graph of y = 1/(x-5) +2.

This second example is based on the same function as the first, that is, y = 1/x.  However, it has been horizontally translated to the right 5 units, and vertically translated up 2 units.  In this graph, you can see that the horizontal asymptote is y = 2, and the vertical asymptote is x = 5.  (Even I sometimes get horizontal and vertical asymptotes mixed up, because I instinctively want to refer to the horizontal ones in terms of x, and the vertical ones in terms of y.  However, it's easier to think of it as 'does the line go up and down,' in which case it's a vertical asymptote located somewhere 'side to side' on the x axis.  Similarly, for horizontal asymptotes, they go 'side to side' and are located somewhere along the vertical y axis.)

What we've seen with these two examples, asymptotes are lines that your graph approaches yet will never intersect or touch.  More specifically, they are lines for which your equation is not defined.  In terms of mathematics, one way an equation is undefined is when its denominator equals zero.  So, with that piece of information, it is easier to see why our asymptotes in these equations are what they are.  The equations of these two graphs are undefined, that is, have a denominator of zero, along their asymptotes.

So, that makes reading graphs to determine their asymptotes easier.  However, what about if you are merely given an equation and asked to perform asymptotic analysis on it?  How could you find asymptotes of an equation without seeing it or drawing the graph first?  Well, as I just showed, it's actually quite easy because all you have to do is determine at what points the denominator will equal zero, and you will have then found where the equation is undefined and has an asymptote.

Let's try a brief example to practice asymptotic analysis of the equation.  If you have a graphing calculator and know how to use it, you can plot these out and check.  But otherwise, let's just look at the equations.

Find asymptotes of f(x) = 200 / (x3 - 8).

For each equation you want to evaluate, it's a good idea to consider if there are both horizontal and vertical asymptotes.  To do that, you have to rearrange the expression to solve for either x or for y, and then evaluate each form to determine where the denominator equals zero.  In this example, it is already expressed in terms of x (remember that you can say y = f(x)), so you can simply examine the bottom of this form of the equation, and solve it by equating it to zero:

x3 - 8 = 0
x3 = 8
x = 2

Therefore, this shows that there is a vertical asymptote along x = 2.

To see if there are any asymptotes along the y axis, you need to rearrange the equation to isolate for the other variable.  With some simple algebra, you can rewrite the expression like so:

y = 200 / (x3 - 8)
x3 - 8 = 200 / y
x3 = (200 / y) + 8

When written this way, it is easy to see that the expression will only be undefined when the term 200/y has a zero as the denominator.  And since this is a simple expression, we can easily see that 200/y is undefined when y = 0.

With this quick asymptotic analysis, we have shown that when x = 2, the denominator equates to zero, which then means that f(2) evaluates to 200 / 0, which is undefined.  And if f(x) is undefined when x = 2, we have determined that f(x) has a vertical asymptote at x = 2.  Similarly, we have shown that there is a horizontal asymptote when y = 0, because when we rearranged the original equation to write it in terms of y, we found again that the expression is undefined with the term 200 / 0 when y = 0.

Here is what this function looks like, all graphed out.  Check it out to verify that we identified the correct values for its asymptotes!

Check the graph to see if our asymptotes make sense.  Looks like the check out ok!

So, with that, you now should be familiar enough with asymptotic lines to be able to identify them in your graphs and equations.  Remember that they are similar to limits, in that they are something that something else approaches without ever making contact.  That is a very rough description, but if you can understand that basic concept, you can build on it to be able to apply it more precisely to your mathematics as I've shown in the above graphing examples.  Another very important thought to keep in your mind is that not every equation has an asymptote.  With a little practice and work, you will be able to look at an equation and be able to say exactly where to find its asymptotes, or even declare that the equation has no asymptotes at all.  Being able to identify asymptotes is a core concept in graphing (and is usually one of the first things you want to do when converting an equation to a graph), and will allow you to work through more complicated math questions, such as ones that ask you to "find domain of rational function" or questions that involve oblique asymptotes... ones that slant on an angle!

You will find asymptotic analysis to be very useful in your math studies, so I hope that this post has at least provided a decent introduction for you to this graphing concept.  As always, please +1 the post (below) if you found it useful.  Thanks!


Related Posts