Variance

Download as PDF

Ever wonder how statisticians describe the 'spread' of data? Variance is a key concept that measures how far a set of numbers are scattered from their average value. A high variance means the data is widely dispersed, while a low variance indicates the data points are clustered closely together.

Variance — an original Algebra911 reference diagram defining variance with its key formula and a worked example.
Understanding Variance: A Beginner's Guide to Measuring Data Spread

What Exactly Is Variance?

Variance is a measure of how spread out a set of data points are from their average (mean) value. In simple terms, it tells you how much your data varies. If the variance is small, it means the data points are all very close to the average. If the variance is large, it means the data points are scattered far from the average and from each other.

Imagine two basketball teams. Team A has five players who are all very close in height: 6'4", 6'5", 6'5", 6'6", and 6'7". The average height is 6'5". Team B also has an average height of 6'5", but its players' heights are 5'8", 6'2", 6'5", 6'10", and 7'2".

Even though both teams have the same average height, the heights on Team B are much more spread out. Team B has a much higher variance than Team A. This single number, the variance, helps us understand this difference in consistency without having to look at every single data point.

Statisticians call this concept of spread or scatter 'dispersion'. Variance is one of the most important measures of dispersion, giving us a numerical value for how 'messy' or 'consistent' a dataset is.

Why Should I Care About Variance?

The average of a dataset can be misleading on its own. Variance provides critical context that helps us make better decisions. Let's consider a few scenarios:

  • In School: A teacher gives a test to two different Algebra classes. Both classes have an average score of 85%. That sounds great! But the variance tells a deeper story. Class 1 has a very low variance, meaning most students scored between 82% and 88%. Class 2 has a very high variance, with many students scoring above 95% and many scoring below 75%. The average is the same, but the teacher's strategy for each class should be different. Class 2 needs more individual support for struggling students and more advanced challenges for high-flyers.
  • In Business: An ice cream shop owner is looking at daily sales. The average sales might be $500 per day. But if the variance is high, it means some days they sell $1000 worth of ice cream and other days only $100. This high variance makes it difficult to manage inventory and staff schedules. A business with low variance in sales is much more predictable and easier to manage.
  • In Science: A scientist is testing two new fertilizers on tomato plants. Both groups of plants have the same average height after two months. However, the plants in Group A have a low variance in height (they are all nearly the same size), while the plants in Group B have a high variance (some are very tall, some are very short). This suggests the fertilizer for Group A is more reliable and consistent in its effect.

In all these cases, variance gives us a clearer picture of the data's consistency and distribution, which is essential for accurate analysis and informed decision-making.

What Are the Building Blocks of Variance?

Before you can calculate variance, you need to understand two fundamental concepts: the mean and deviation.

1. The Mean (Average)

The mean is simply the average of all the numbers in your dataset. You find it by adding up all the values and dividing by the count of values. We use the Greek letter μ (mu) to represent the mean of a whole population and x¯ ('x-bar') for the mean of a sample.

2. Deviation from the Mean

The deviation tells us how far a single data point is from the mean. The formula is simply:

Deviation = Data Point (xi) - Mean (μ or x¯)

A positive deviation means the data point is above the average. A negative deviation means it's below the average. A deviation of zero means it's exactly the average.

You might think, 'Why don't we just find the average of all the deviations to measure spread?' That's a great question! Let's try it with a simple dataset: {2,5,8}.

  1. Find the mean: μ=(2+5+8)/3=15/3=5
  2. Find the deviations:
    For x1=2, deviation is 25=3
    For x2=5, deviation is 55=0
    For x3=8, deviation is 85=3
  3. Average the deviations: (3+0+3)/3=0/3=0

The average deviation is zero! This happens with every single dataset because the positive and negative deviations always cancel each other out perfectly. To solve this problem, mathematicians decided to get rid of the negative signs by squaring each deviation. This makes every value positive and leads us directly to the calculation for variance.

How Do You Calculate Variance for a Whole Population?

When you have data for every single member of a group you're interested in, you have a population. For example, if you want to know the variance of test scores for all 25 students in your specific math class, that class is your population.

The formula for population variance, represented by σ2 (sigma squared), is the average of the squared deviations.

σ2=i=1N(xiμ)2N

That might look complicated, but it's just a mathematical way of describing these steps:

  1. Calculate the Mean (μ): Add up all the data points and divide by the number of data points (N).
  2. Calculate Deviations: For each data point (xi), subtract the mean (xiμ).
  3. Square the Deviations: Square each of the results from Step 2 to make them all positive ((xiμ)2).
  4. Sum the Squares: Add up all the squared deviations from Step 3 (this is the part of the formula).
  5. Divide by N: Divide the sum from Step 4 by the total number of data points (N) to find the average.
Example 1

Let's find the population variance for a student's five quiz scores: {8,9,10,7,6}. We consider this a population because we are only interested in these five quizzes.

Step 1: Find the mean (μ).
μ=8+9+10+7+65=405=8

Step 2 & 3: Find and square the deviations.

  • (88)2=02=0
  • (98)2=12=1
  • (108)2=22=4
  • (78)2=(1)2=1
  • (68)2=(2)2=4

Step 4: Sum the squared deviations.
(xiμ)2=0+1+4+1+4=10

Step 5: Divide by N.
σ2=105=2

The population variance of the quiz scores is 2.

What's the Difference Between Population and Sample Variance?

It's often impossible to collect data from an entire population. Can you imagine polling every voter in a country or measuring every tree in a forest? Instead, we take a sample—a smaller, manageable group that represents the larger population.

When we calculate variance for a sample, our goal is to estimate the variance of the whole population. There's a small but crucial change to the formula to make this estimate more accurate.

The formula for sample variance, represented by s2, is:

s2=i=1n(xix¯)2n1

Notice the two key differences: we use x¯ for the sample mean, and we divide by n1 instead of n (where n is the sample size).

Why divide by n1?

This is known as Bessel's correction. In short, a sample is less likely to include the most extreme values from the population. Because of this, a sample's variance naturally tends to be a bit smaller than the true population's variance. By dividing by a slightly smaller number (n1), we increase the final result, giving us a better, more unbiased estimate of the population variance.

Example 2

A biologist is studying a new type of plant. From a field of hundreds of plants, she takes a random sample of 6 plants and measures their heights in centimeters: {22,25,19,28,24,20}.

Step 1: Find the sample mean (x¯).
x¯=22+25+19+28+24+206=1386=23

Step 2 & 3: Find and square the deviations from the sample mean.

  • (2223)2=(1)2=1
  • (2523)2=22=4
  • (1923)2=(4)2=16
  • (2823)2=52=25
  • (2423)2=12=1
  • (2023)2=(3)2=9

Step 4: Sum the squared deviations.
(xix¯)2=1+4+16+25+1+9=56

Step 5: Divide by n1. Here, n=6, so n1=5.
s2=565=11.2

The sample variance of the plant heights is 11.2.

Key formulas for variance by Algebra911.
Key formulas for variance by Algebra911.

How Is Variance Related to Standard Deviation?

Variance is a powerful statistical tool, but it has one major drawback: its units are weird. In our quiz score example, the variance was 2. But what are the units? Since we squared the deviations (which were in 'points'), the variance is in 'points squared'. In the plant height example, the variance was 11.2 'centimeters squared'. What does a square centimeter of height even mean? It's not intuitive at all.

This is where standard deviation comes to the rescue. It is the practical and more famous sibling of variance.

The standard deviation is simply the square root of the variance. It returns the measure of spread back to the original units of the data, making it much easier to interpret.

  • Population Standard Deviation: σ=σ2
  • Sample Standard Deviation: s=s2

Standard deviation tells you, on average, how far each data point is from the mean. A standard deviation of 5.1 cm is much easier to understand than a variance of 26.4 cm2.

Example 3

Let's find the standard deviation for the plant height data from Example 2.

Step 1: Find the sample variance.
We already calculated this! The sample variance was s2=11.2 cm2.

Step 2: Take the square root of the variance.
s=11.23.35

The sample standard deviation is approximately 3.35 cm. This means that, on average, the height of a plant in this sample is about 3.35 cm away from the sample mean of 23 cm. This is a much more useful and understandable measure of spread.

What Are Some Common Mistakes When Calculating Variance?

Calculating variance involves several steps, so it's easy to make a small error along the way. Here are some common pitfalls to watch out for:

  • Forgetting to square deviations: A very common mistake is to sum the deviations themselves. Remember, they always add up to zero! You must square each deviation before you add them together.
  • Using the wrong denominator: This is the most frequent conceptual error. Remember the rule: if you have data for the entire population, divide the sum of squares by N. If you have a sample of a larger population, divide by n1.
  • Rounding too early: If your mean is a decimal (e.g., 4.666...), keep as many decimal places as possible during your intermediate calculations. Rounding the mean too early can lead to a significant error in your final answer.
  • Confusing variance and standard deviation: Always double-check if the question is asking for variance (σ2 or s2) or standard deviation (σ or s). Don't forget to take the square root at the end if you need the standard deviation.
  • Calculation errors: Be careful when squaring negative numbers. Remember that a negative number squared is always positive (e.g., (4)2=16, not 16).

Can I Get a Quick Summary and Reference?

Absolutely! Here's a quick recap of the key ideas:

Variance measures how spread out data points are from their mean. A large variance means data is widely scattered; a small variance means data is tightly clustered. It's calculated by finding the average of the squared distances from the mean.

The main reason we use variance is to get a numerical value for the 'consistency' or 'volatility' of a dataset. However, its units are squared, which can be hard to interpret. That's why we often take the square root to find the standard deviation, which is in the original units of the data.

Here is a handy reference table to help you remember the formulas:

MeasurePopulation (Data for the entire group)Sample (Data for a subset of a group)
Meanμ=xiNx¯=xin
Varianceσ2=(xiμ)2Ns2=(xix¯)2n1
Standard Deviationσ=(xiμ)2Ns=(xix¯)2n1

Frequently Asked Questions

Can variance ever be a negative number?

No, variance can never be negative. The calculation involves squaring the differences from the mean, and the square of any number (positive or negative) is always positive. The smallest possible variance is zero.

What does it mean if the variance is zero?

A variance of zero means there is no spread in the data at all. This only happens when every single data point in the set is exactly the same, such as in the dataset {5, 5, 5, 5}. If all numbers are the same, they are all equal to the mean, so there is no variation.

Why do we divide by n-1 for sample variance?

We divide by n-1 as a correction to make the sample variance a better estimate of the true population variance. A sample tends to underestimate the spread of the full population, and dividing by a smaller number (n-1 instead of n) slightly increases the result to compensate for this.

Which is more useful, variance or standard deviation?

Both are important, but standard deviation is usually more useful for interpreting results. Because standard deviation is in the same units as the original data, it's easier to understand its meaning in a real-world context.

Is a high variance good or bad?

It's neither good nor bad; it's all about context. A high variance is 'bad' if you want consistency, like in a manufacturing process. A high variance might be 'good' for an investor looking for a high-risk, high-reward stock.

What's the difference between variance and range?

The range is the simplest measure of spread, calculated as the highest value minus the lowest value. Variance is more sophisticated because it uses every single data point to describe the spread, making it a more robust and reliable measure.

How does an outlier affect variance?

An outlier, which is a data point far away from the others, can dramatically increase the variance. Because variance is based on squared distances from the mean, a large distance created by an outlier gets magnified, significantly inflating the measure of spread.