Assuming you have a basic understanding of the concepts of Variance and Standard Deviation,
it's now time to take out your calculator and start calculating them.
The focus of this video is to cover the formulas for both Variance and Standard Deviation,
and provide step-by-step explanations of how to calculate these two statistics.
Just a quick review related to the symbols used in the formulas
and the relationship between Variance and Standard Deviation.
Remember that the symbols for each differ based upon if you are referencing a population
or a sample. And remember too that the square root of Variance is Standard Deviation,
Meaning that if you know how to calculate Variance, it is one more
simple step to calculate Standard Deviation.
So we'll start with how to calculate Variance.
Just like any formula, you can see the formula for Variance
written in a variety of ways, but we will stick with something that is fairly simple.
Just as there are different symbols depending upon whether you are
dealing with a population or a sample, there are also different formulas
depending upon whether you are calculating Variance for a population or a sample.
Fortunately, there isn't much difference between the two formulas
other than the symbols, but there is one key difference that I will point out in a moment.
Let's focus on the formula for calculating Variance for a sample--
this bottom, one as you probably recognize the x-bar as the symbol for the mean.
We'll start with the numerator.
if you recall the order of operations in a formula, and
I remember it as PEMDAS, or Please Excuse My Dear Aunt Sally, or
Parentheses, Exponents, Multiplication, Division, Addition, and Subtraction,
You'll start by calculating the stuff in parentheses.
x refers to the individual score, so this formula is telling you
that you take each score in the dataset and subtract the mean from it.
Go next to the exponent which says that you square what you've got
so x minus x-bar squared.
This interim statistic is called Deviation.
You do this for each score in the dataset.
That means that if you have ten scores, you will do 10 calculations here:
The first score minus the mean, squared;
then the second score minus the mean, squared; etc.
You are calculating Squared Deviation.
I know it's time consuming, but
unfortunately, that's what you have to do.
The uppercase Sigma symbol means sum, or
the addition part of the order of operations. So now you take the results
of all of those calculations--all of the Squared Deviations--and add them together.
Now you have Variation, or Total Squared Variation: the sum of the squared
differences between a set of scores and the mean. Variation is how we measure of
variability, given that science can be defined as the systematic study of variability.
Now look at the denominator: a small n is the symbol for the number
of observations in a sample dataset. If you have ten scores, then the sample size,
the n, equals 10. And by following the formula, we will subtract 1 from the
number of observations in the dataset. So, if your dataset consists of ten scores,
you would divide by 10-1, or 9.
To summarize, to calculate the Variance of a sample,
you take the difference between each score and the mean, and square it.
Add up all the results, then divide by the number of observations minus 1.
Before we do it, let's look at the formula for a population, which is
essentially the same but with different symbols. You'll notice that instead of
the x-bar, you'll see the Greek symbol mu -- and that's the u with the tail on the bottom front.
Just as the x-bar is the symbol for the mean of a sample,
mu is the symbol for the mean of a population.
So you do the same thing in the numerator here
as you do when calculating the numerator for the sample:
Subtract the mean from the score, and then square it.
Do it for each score in the data set and then add all of the results together.
Looking at the denominator.
you'll see that the lower case and is replaced with an upper case in which
says that we are interested in the number of cases in the population and
you'll also see that we are dividing by N, not by n minus 1. This is really
the only substantive difference between the two formulas, which takes into
account an unbiased estimator of the population variance. And don't worry about it now;
just know that the only real difference between calculating Variance from a sample
versus a population. The formula never changes;
the only thing that changes is the data we put into it. And unless you have a
reason otherwise, round your results to the hundreds or the second decimal place.
There are six steps to calculating Variance. First, count the numbers, or the
number of observations in the dataset. Then calculate the mean for the dataset.
Then, for each score, you subtract the mean from it, so you'll get the
difference, or the Deviation, of each score and the mean.
Square that for the squared difference. or the squared deviation, and note that, by squaring,
you will always have a positive number.
Add up all the scores you got from step 4 to get Variation.
And, finally, divide by the number of scores, if you're calculating Variance for a population,
or by the number of scores minus 1 if you are calculating Variance for a sample.
Let's go back to our Rotten Tomatoes list of
the 25 best Christmas movies and use those scores for our example.
And to make it easier on us, let's just use the top 12.
As this is not a sample but a population--
we are really only looking for the Variance in the top 12 scores--
We'll use that formula.
When calculating Variance by hand, I find it helpful to set up a table
with the steps listed across the top.
We'll start by counting the number of cases,
which, as it is the top 12, is 12. N= 12.
Then we calculate the mean,
which is the sum of all of the scores divided by the number of scores, which is
94.5. So let's fill in the second column with the mean.
Now, for each score we subtract the mean from it
to find out how much it deviates from the mean--to find Deviation.
So the first score of 89, minus the mean of 94.5 is negative 5.5.
Continuing, our next step is to square the Deviation. so negative 5.5 squared is
30.25--Deviation Squared. We do this for the next score: 91 minus the mean of 94.5
is negative 3.5 which, squared, is 12.25.
We have to do this for all 12 scores-- both the Deviation and the Deviation Squared.
We've now done the x minus the mean squared part of the formula,
and this is where Sigma comes into play:
We need to add all the Deviation Squared results together, which sums to 129--
Variation. Now you can see why we have to square the deviation
to make sure we have positive numbers. Otherwise, if we added just the
deviations together, the negative numbers would cancel the positive numbers out
and our sum would be 0.
we've completed all the calculations now for the numerator of our formula.
So there's just one more step.
Remember that in this example, we are calculating Variance for a population so
we need to divide by N, which we previously identified as 12.
120 divided by 12 is 10.75,
So our Variance for this population is 10.75.
now if we were to do this for a sample instead of for a population,
we would have to change the formula,
which, as you recall, really only differs in the denominator,
when we divide by n minus 1 instead of N.
But say that, instead of looking at Rotten Tomatoes'
top-rated Christmas movies, we wanted to look at their ratings for the
movies that came out in 2015 which, according to the website, the numbers, was
almost 2,400 movies. That's a lot of movies and a lot of calculations.
So, rather than go through these calculations for all 2397 of them, we
randomly sample to create a dataset of 12 movies. Okay, 12 is a small number to
generalize to this large population, but I'm trying to make this easy for you.
If you notice--just to keep this correct-- I've changed all the mus in the column
headings to x-bar, and the big N to a little n.
All the calculations are the same until we get to the last step,
which is where we divide the sum of the
deviation squared by the denominator of the formula, which is n minus 1 instead of N.
So 129 divided by 11 is 11.73, which is the Variance for a sample.
Now let's take one more step to calculate Standard Deviation.
If you recall from earlier, Standard Deviation is the square root of Variance, so the
formula for Standard Deviation is the same as the one for Variance,
but just the square root of it
The first steps to calculating Standard Deviation are identical to calculating Variance:
Count the numbers, calculate the mean, calculate
the differences between each score and the mean--the Deviations. Square those
deviation, sum the results, and then divide by either n minus 1, if you're
calculating for a sample, or N, if you are calculating for a population.
You'll end up with Variance. Then you just take the square root of that to get the
Standard Deviation. Pretty simple, right?
I doesn't hurt to practice calculating Variance
on the way to calculating Standard Deviation.
We'll use a different set of numbers for this example.
Let's assume that we are interested in knowing
the variation in the amount of sleep people in my family get in an average night.
We are talking about my entire family of, let's say, 10 people. so we will
use the formula for a population rather than a sample. And the N, or the number
of observations in the dataset, is 10.
The mean is 6.85, so we can fill in the second column with the mean.
Now we calculate the deviation for each score.
So the first score of 8 minus the mean, 6.85, is 1.15.
Squared is 1.32--deviation squared.
For the next score, 4.5 minus the mean of 6.85 is
negative 2.35 which, squared, is 5.52.
We have to continue until we've calculated for all
the scores--both the Deviation and the Deviation Squared. Then we add all the
Deviation Squared results together, which sums to 31.53.
As we are calculating for population we divide by N, or 10.
31.53 divided by 10, after rounding is 3.15,
So our Variance for this population is 3.15.
To get the Standard Deviation, we finish off by taking the square root of Variance,
which, after rounding, is 1.78--our Standard Deviation.
Okay, let's do this again,
assuming that the 10 family members we got data from were not my entire family
but a sample of my family.
that means we need to change out the formula
so that the denominator is n-1 instead of N.
The initial calculations are the same,
except that we now divide by n minus 1, or in this case, by 9
to get the Variance of 3.50.
Now when we take the square root of that we get a
standard deviation for our sample of 1.87.
Just for the heck of it, let's quickly graph this data.
Our mean was 6.65 hours of sleep and the Standard Deviation was 1.87.
6.65 plus a standard deviation of 1.87 is 8.52,
which gets plotted at one standard deviation above the mean.
Then two standard deviations above the mean would be the mean of 6.65 + 1.87 times 2,
or 10.39, and three standard deviations above the mean would be 12.26.
Now for the negative standard deviations:
the mean of 6.65 minus one standard deviation,
or 1.87, is 4.78 which plots at one standard deviation below the mean.
The mean minus two standard deviations is 2.91.
and minus 3 standard deviations is 1.04.
Remember we said earlier that there is a 68% probability
that a score is within plus or minus one standard deviation of the mean,
a 95% probability that is scores within plus or minus 1.96 standard deviations of the mean,
and a 99% probability that a score is within plus or minus 2.58 standard deviation of the mean.
We'd already figured out the one standard deviation for 68%,
For 95%, we multiply the standard deviation of 1.87 by 1.96 for 3.67.
And, for 99%, we multiply the standard deviation by 2.58, for 4.82.
This says that there is a 68% probability that a person in my extended
family sleeps between 4.75 and 8.52 hours per night, and a 95% possibility
that a person sleeps between 2.98 and 10.32 hours per night, and a 99%
probability that the family member logs between 1.83 ad 11.47 hours of sleep per night.
Processing Time
What is the difference between the Variance formula for a population and a sample?
Other than the symbols, the major difference comes in the denominator.
For a population, you divide by the number of observations in the population:N.
For a sample, you divide by the number of observations in the sample minus 1: n minus 1.
What is the relationship between the formulas for Variance and Standard Deviation?
Standard Deviation is the square root of Variance.
If you know the Variance, you can calculate Standard Deviation.
Similarly, if you know Standard Deviation, square it and you've got the Variance.
Now if you were given a dataset and you knew that the dataset represented a sample or a population,
you should easily be able to calculate both Variance and the Standard Deviation.
for that data set.