• About
  • Contact
  • Cookie
  • Disclaimer
  • Privacy Policy
  • Change the purpose of use

Tnhelearning.edu.vn - Various useful general information portal

  • Photo
  • Bio
  • How To
  • Tech

How to Calculate Variance

August 6, 2023 by admin Category: How To

You are viewing the article How to Calculate Variance  at Tnhelearning.edu.vn you can quickly access the necessary information in the table of contents of the article below.

Variance is a statistical measure that quantifies the spread or dispersion of a dataset. It helps us understand the extent to which individual data points in a set differ from the mean or average value. By calculating the variance, we can gain valuable insights into the variability and overall distribution of the data, which can be crucial in various fields, including finance, economics, and research. This guide will provide step-by-step instructions on how to calculate variance, allowing you to better understand and analyze diverse datasets. Whether you are a student, researcher, or simply interested in statistics, mastering the calculation of variance can enhance your ability to interpret and draw meaningful conclusions from data.

X

This article was co-written by Mario Banuelos, PhD. Mario Banuelos is an assistant professor of mathematics at California State University, Fresno. With over eight years of teaching experience, Mario specializes in mathematical biology, optimization, statistical modeling for genome evolution, and data science. Mario holds a bachelor’s degree in mathematics from California State University, Fresno, and a doctorate in applied mathematics from the University of California, Merced. Mario teaches at both the high school and college levels.

This article has been viewed 240,483 times.

Variance measures the dispersion of a data set. It is very useful in building statistical models: low variance can be a sign that you are describing random error or noise rather than an implicit relationship in the data. With this article, the wikiHow will teach you how to calculate variance.

Table of Contents

  • Steps
    • Calculating the variance of a sample
    • Calculating the variance of a population
  • Advice

Steps

Calculating the variance of a sample

Image titled Calculate Variance Step 1

Image titled Calculate Variance Step 1

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/d/d0/Calculate-Variance-Step-1-Version-4.jpg/v4-460px-Calculate-Variance-Step-1- Version-4.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/d/d0/Calculate-Variance-Step-1-Version-4.jpg/v4-728px-Calculate- Variance-Step-1-Version-4.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Write your sample dataset. In most cases, statisticians only have information about a sample, or subset, of the population they are studying. For example, instead of analyzing the “cost of every car in Germany” population as a whole, a statistician might find the cost of a random sample of a few thousand cars in size. The statistician can use this sample to get a good estimate of the cost of cars in Germany. However, most likely it will not completely coincide with the actual numbers.

  • Example: When analyzing the number of muffins sold each day at a coffee shop, you take a random six-day sample and get the following results: 38, 37, 36, 28, 18, 14, 12, 11, 10.7, 9.9. This is a sample, not a population, because you don’t have data for all store opening days.
  • If there are every data point in the population, go to the method below.
Image titled Calculate Variance Step 2

Image titled Calculate Variance Step 2

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/0/07/Calculate-Variance-Step-2-Version-4.jpg/v4-460px-Calculate-Variance-Step-2- Version-4.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/0/07/Calculate-Variance-Step-2-Version-4.jpg/v4-728px-Calculate- Variance-Step-2-Version-4.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Write the formula for sample variance. The variance of a dataset indicates how scattered the data points are. The closer the variance is to zero, the closer the data points are grouped together. When working with sample data, use the following variance formula: [1] X Research Source

  • S2{displaystyle s^{2}}s^{2} = [(xi{displaystyle x_{i}}x_{i} – x̅)2{displaystyle ^{2}}^{2} ] / (n – 1)
  • S2{displaystyle s^{2}}s^{2} is the variance. Variance is always measured in squared units.
  • xi{displaystyle x_{i}}x_{i} represents a value in your tuple.
  • ∑, which means “sum”, tells you what parameters to follow for each value xi{displaystyle x_{i}}x_{i} , and then add them together.
  • x̅ is the mean of the sample.
  • n is the number of data points.
Image titled Calculate Variance Step 3

Image titled Calculate Variance Step 3

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/c/ce/Calculate-Variance-Step-3-Version-4.jpg/v4-460px-Calculate-Variance-Step-3- Version-4.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/c/ce/Calculate-Variance-Step-3-Version-4.jpg/v4-728px-Calculate- Variance-Step-3-Version-4.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Calculate the mean of the sample . The symbol x̅ or “x-horizontal” is used to indicate the sample mean. [2] X Research Source Do the same calculation as you would for any mean: add up all the data points and divide the total by the number of points.

  • Example: First, add the data points together: 17 + 15 + 23 + 7 + 9 + 13 = 84
    Next, divide the result obtained by the number of data points, in this case six: 84 ÷ 6 = 14.
    Sample mean = x̅ = 14 .
  • You can think of the mean as the “center point” of the data. If the data is centered around the mean, the variance is low. If they are scattered far from the mean, the variance is high.
READ More:   How to Recognize the Signs of Depression
Image titled Calculate Variance Step 4

Image titled Calculate Variance Step 4

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/d/d5/Calculate-Variance-Step-4-Version-4.jpg/v4-460px-Calculate-Variance-Step-4- Version-4.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/d/d5/Calculate-Variance-Step-4-Version-4.jpg/v4-728px-Calculate- Variance-Step-4-Version-4.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Subtract the mean from each data point. Now is the time to count xi{displaystyle x_{i}}x_{i} – x̅, in which xi{displaystyle x_{i}}x_{i} is each point in your dataset. Each result obtained will indicate the deviation from the mean of each corresponding point, or simply put, the distance from it to the mean. [3] X Research Sources .

  • For example:
    xfirst{displaystyle x_{1}}x_{1} – x̅ = 17 – 14 = 3
    x2{displaystyle x_{2}}x_{2} – x̅ = 15 – 14 = 1
    x3{displaystyle x_{3}}x_{3} – x̅ = 23 – 14 = 9
    x4{displaystyle x_{4}}x_{4} – x̅ = 7 – 14 = -7
    x5{displaystyle x_{5}}x_{5} – x̅ = 9 – 14 = -5
    x6{displaystyle x_{6}}x_{6} – x̅ = 13 – 14 = -1
  • It is very easy to check your calculation, because the results obtained must sum to 0. That is because by definition of the mean, the results are negative (distance from mean to small numbers). more) completely cancel out the positive result (distance from mean to larger numbers).
Image titled Calculate Variance Step 5

Image titled Calculate Variance Step 5

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/0/02/Calculate-Variance-Step-5-Version-4.jpg/v4-460px-Calculate-Variance-Step-5- Version-4.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/0/02/Calculate-Variance-Step-5-Version-4.jpg/v4-728px-Calculate- Variance-Step-5-Version-4.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Square all results. As noted above, the current offset list ( xi{displaystyle x_{i}}x_{i} – x̅) sums to 0. That is, the “mean deviation” will also always be zero and can’t say anything about the dispersion of the data. To solve this problem, we find the square of each deviation. As a result, all are positive, negative and positive values no longer cancel each other out and sum to zero. [4] X Research Sources

  • For example:
    ( xfirst{displaystyle x_{1}}x_{1} – x̅) 2=32=9{displaystyle ^{2}=3^{2}=9}^{2}=3^{2}=9
    (x2{displaystyle (x_{2}}(x_{2} – x̅) 2=first2=first{displaystyle ^{2}=1^{2}=1}^{2}=1^{2}=1
    9 2 = 81
    (-7) 2 = 49
    (-5) 2 = 25
    (-1) 2 = 1
  • Now you have ( xi{displaystyle x_{i}}x_{i} – x̅) 2{displaystyle ^{2}}^{2} for each data point in the sample.
Image titled Calculate Variance Step 6

Image titled Calculate Variance Step 6

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/c/c1/Calculate-Variance-Step-6-Version-3.jpg/v4-460px-Calculate-Variance-Step-6- Version-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/c/c1/Calculate-Variance-Step-6-Version-3.jpg/v4-728px-Calculate- Variance-Step-6-Version-3.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Find the sum of the squared values. Now it’s time to calculate the entire numerator of the formula: ∑[( xi{displaystyle x_{i}}x_{i} – x̅) 2{displaystyle ^{2}}^{2} ]. Great Sigma, , requires you to add the following element value for each value xi{displaystyle x_{i}}x_{i} . You have calculated ( xi{displaystyle x_{i}}x_{i} – x̅) 2{displaystyle ^{2}}^{2} for each value xi{displaystyle x_{i}}x_{i} in the sample, so all you have to do is add the results together.

  • For example: 9 + 1 + 81 + 49 + 25 + 1 = 166 .
Image titled Calculate Variance Step 7

Image titled Calculate Variance Step 7

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/4/4d/Calculate-Variance-Step-7-Version-3.jpg/v4-460px-Calculate-Variance-Step-7- Version-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/4/4d/Calculate-Variance-Step-7-Version-3.jpg/v4-728px-Calculate- Variance-Step-7-Version-3.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Divide by n – 1, where n is the number of data points. Long ago, when calculating sample variance, statisticians just divided by n. That division will give you the mean of the squared deviation, which exactly matches the variance of that sample. However, keep in mind that the sample is only an estimate of a larger population. If you take another random sample and do the same calculation, you will get a different result. Turns out, dividing by n -1 instead of n gives you a better estimate of the variance of the larger population – which you really care about. This correction is so popular that it is now the accepted definition of sample variance. [5] X Research Sources

  • Example: There are six data points in the sample, so n = 6.
    Sample Variance = S2=1666−first={displaystyle s^{2}={frac {166}{6-1}}=}s^{2}={frac {166}{6-1}}= 33.2
Image titled Calculate Variance Step 8

Image titled Calculate Variance Step 8

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/e/ee/Calculate-Variance-Step-8-Version-3.jpg/v4-460px-Calculate-Variance-Step-8- Version-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/e/ee/Calculate-Variance-Step-8-Version-3.jpg/v4-728px-Calculate- Variance-Step-8-Version-3.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser -output”></div>”}
Understand variance and standard deviation. Note that, because there is a power in the formula, the variance is measured by the unit square of the original data. This is visually confusing. Instead, usually the standard deviation is quite useful. But you’re not wasting your time either, because the standard deviation is determined by the square root of the variance. That is why the sample variance is written as S2{displaystyle s^{2}}s^{2} , and the standard deviation of a sample is S{displaystyle s}S .

  • For example, the standard deviation of the above sample = s = √33.2 = 5.76.
READ More:   How to Manually Reset the Wi Fi Adapter (Windows)

Calculating the variance of a population

Image titled Calculate Variance Step 9

Image titled Calculate Variance Step 9

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/d/d4/Calculate-Variance-Step-9.jpg/v4-460px-Calculate-Variance-Step-9.jpg”,” bigUrl”:”https://www.wikihow.com/images/thumb/d/d4/Calculate-Variance-Step-9.jpg/v4-728px-Calculate-Variance-Step-9.jpg”,”smallWidth” :460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Start with the overall dataset. The term “population” is used to refer to the entire set of related observations. For example, if you are studying the age of residents of Hanoi, your total would include the age of all individuals living in Hanoi. Normally you would create a spreadsheet for a large dataset like this, but here is a smaller example dataset:

  • Example: In the room of an aquarium, there are exactly six aquariums. These six tanks contain the following number of fish respectively:
    xfirst=5{displaystyle x_{1}=5}x_{1}=5
    x2=5{displaystyle x_{2}=5}x_{2}=5
    x3=8{displaystyle x_{3}=8}x_{3}=8
    x4=twelfth{displaystyle x_{4}=12}x_{4}=12
    x5=15{displaystyle x_{5}=15}x_{5}=15
    x6=18{displaystyle x_{6}=18}x_{6}=18
Image titled Calculate Variance Step 10

Image titled Calculate Variance Step 10

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/a/a7/Calculate-Variance-Step-10.jpg/v4-460px-Calculate-Variance-Step-10.jpg”,” bigUrl”:”https://www.wikihow.com/images/thumb/a/a7/Calculate-Variance-Step-10.jpg/v4-728px-Calculate-Variance-Step-10.jpg”,”smallWidth” :460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Write the formula for the population variance. Since the population contains all the data we need, this formula gives us the exact variance of the population. To distinguish it from the sample variance (which is just an estimate), statisticians use other variables: [6] X Research Source

  • σ 2{displaystyle ^{2}}^{2} = (∑(xi{displaystyle x_{i}}x_{i} – μ)2{displaystyle ^{2}}^{2} ) / n
  • σ 2{displaystyle ^{2}}^{2} = sample variance. This is the normal squared sima. Variance is measured by the square of the unit.
  • xi{displaystyle x_{i}}x_{i} represents an element in your tuple.
  • Elements within will be calculated for each value xi{displaystyle x_{i}}x_{i} , and then added together.
  • μ is the overall mean.
  • n number of data points in the population.
Image titled Calculate Variance Step 11

Image titled Calculate Variance Step 11

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/5/5e/Calculate-Variance-Step-11.jpg/v4-460px-Calculate-Variance-Step-11.jpg”,” bigUrl”:”https://www.wikihow.com/images/thumb/5/5e/Calculate-Variance-Step-11.jpg/v4-728px-Calculate-Variance-Step-11.jpg”,”smallWidth” :460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Find the mean of the population. When analyzing the population, the symbol μ (“mu”) represents the arithmetic mean. To find the mean, add up all the data points, then divide by the number of points.

  • You can think of the mean as “average,” but be careful, because the word has many definitions in math.
  • Example: mean = μ = 5+5+8+twelfth+15+186{displaystyle {frac {5+5+8+12+15+18}{6}}}{frac {5+5+8+12+15+18}{6}} = 10.5
Image titled Calculate Variance Step 12

Image titled Calculate Variance Step 12

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/e/ee/Calculate-Variance-Step-12.jpg/v4-460px-Calculate-Variance-Step-12.jpg”,” bigUrl”:”https://www.wikihow.com/images/thumb/e/ee/Calculate-Variance-Step-12.jpg/v4-728px-Calculate-Variance-Step-12.jpg”,”smallWidth” :460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Subtract the mean from each data point. Data points closer to the mean have a difference of closer to zero. Repeat the subtraction problem for all the data points, and you’ll probably start to get a feel for how scattered the data is.

  • For example:
    xfirst{displaystyle x_{1}}x_{1} – μ = 5 – 10.5 = -5.5
    x2{displaystyle x_{2}}x_{2} – μ = 5 – 10.5 = -5.5
    x3{displaystyle x_{3}}x_{3} – μ = 8 – 10.5 = -2.5
    x4{displaystyle x_{4}}x_{4} – μ = 12 – 10., = 1.5
    x5{displaystyle x_{5}}x_{5} – μ = 15 – 10.5 = 4.5
    x6{displaystyle x_{6}}x_{6} – μ = 18 – 10.5 = 7.5
Image titled Calculate Variance Step 13

Image titled Calculate Variance Step 13

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/8/87/Calculate-Variance-Step-13.jpg/v4-460px-Calculate-Variance-Step-13.jpg”,” bigUrl”:”https://www.wikihow.com/images/thumb/8/87/Calculate-Variance-Step-13.jpg/v4-728px-Calculate-Variance-Step-13.jpg”,”smallWidth” :460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Square each sign. At this point, some results obtained from the previous step will be negative and some will be positive. If you visualize the data on an isometric line, these two items represent the numbers to the left and right of the mean. This will not help in calculating the variance, because the two groups will cancel each other out. Instead, square them all so they are all positive.

  • For example:
    ( xi{displaystyle x_{i}}x_{i} – μ) 2{displaystyle ^{2}}^{2} for each value of i running from 1 to 6:
    (-5,5) 2{displaystyle ^{2}}^{2} = 30.25
    (-5,5) 2{displaystyle ^{2}}^{2} = 30.25
    (-2.5) 2{displaystyle ^{2}}^{2} = 6.25
    (1.5) 2{displaystyle ^{2}}^{2} = 2.25
    (4,5) 2{displaystyle ^{2}}^{2} = 20.25
    (7.5) 2{displaystyle ^{2}}^{2} = 56.25
Image titled Calculate Variance Step 14

Image titled Calculate Variance Step 14

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/0/05/Calculate-Variance-Step-14.jpg/v4-460px-Calculate-Variance-Step-14.jpg”,” bigUrl”:”https://www.wikihow.com/images/thumb/0/05/Calculate-Variance-Step-14.jpg/v4-728px-Calculate-Variance-Step-14.jpg”,”smallWidth” :460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
Find the average of your results. You now have a value for each data point, related (not directly) to how far away that data point is from the mean. Take the average by adding them together and then dividing by the number of values you have.

  • For example:
    Overall variance = 30,25+30,25+6,25+2,25+20,25+56,256=145,56={displaystyle {frac {30,25+30,25+6,25+2,25+2,25+56,25}{6}}={frac {145,5}{6}}=}{frac {30,25+30,25+6,25+2,25+2,25+56,25}{6}}={frac {145,5}{6}}= 24.25
READ More:   How to Run C Programs in Command Prompt
  • Image titled Calculate Variance Step 15

    Image titled Calculate Variance Step 15

    {“smallUrl”:”https://www.wikihow.com/images_en/thumb/2/29/Calculate-Variance-Step-15.jpg/v4-460px-Calculate-Variance-Step-15.jpg”,” bigUrl”:”https://www.wikihow.com/images/thumb/2/29/Calculate-Variance-Step-15.jpg/v4-728px-Calculate-Variance-Step-15.jpg”,”smallWidth” :460,”smallHeight”:345,”bigWidth”:728,”bigHeight”:546,”licensing”:”<div class=”mw-parser-output”></div>”}
    Contact formula. If you’re not sure how this fits with the formula given at the top of the method, write down the whole problem by hand, and don’t abbreviate it:

    • After finding the difference from the mean and squaring it, you have ( xfirst{displaystyle x_{1}}x_{1} – μ) 2{displaystyle ^{2}}^{2} , ( x2{displaystyle x_{2}}x_{2} – μ) 2{displaystyle ^{2}}^{2} , and so on until ( xn{displaystyle x_{n}}x_{n} – μ) 2{displaystyle ^{2}}^{2} , in there xn{displaystyle x_{n}}x_{n} is the last data point in the dataset.
    • To find the mean of these values, you add them up and divide by n: ( ( xfirst{displaystyle x_{1}}x_{1} – μ) 2{displaystyle ^{2}}^{2} + ( x2{displaystyle x_{2}}x_{2} – μ) 2{displaystyle ^{2}}^{2} + … + ( xn{displaystyle x_{n}}x_{n} – μ) 2{displaystyle ^{2}}^{2} ) / n
    • After rewriting the numerator in sigma notation, you have (∑(xi{displaystyle x_{i}}x_{i} – μ)2{displaystyle ^{2}}^{2} ) / n , the variance formula.
  • Advice

    • Because variance is difficult to interpret, this value is often calculated as the starting point from which to find the standard deviation.
    • Using “n-1” instead of “n” in the denominator when analyzing samples is a technique known as the Bessel correction. The sample is only an estimate of a complete population, and the sample mean has a certain bias to match that estimate. This correction eliminates the upper bias. [7] X Research Source It has to do with the fact that once n -1 data points are listed, the nth last point is already a constant, because only certain values are used to calculate the value. sample mean (x̅) in the variance formula. [8] X Research Sources
    X

    This article was co-written by Mario Banuelos, PhD. Mario Banuelos is an assistant professor of mathematics at California State University, Fresno. With over eight years of teaching experience, Mario specializes in mathematical biology, optimization, statistical modeling for genome evolution, and data science. Mario holds a bachelor’s degree in mathematics from California State University, Fresno, and a doctorate in applied mathematics from the University of California, Merced. Mario teaches at both the high school and college levels.

    This article has been viewed 240,483 times.

    Variance measures the dispersion of a data set. It is very useful in building statistical models: low variance can be a sign that you are describing random error or noise rather than an implicit relationship in the data. With this article, the wikiHow will teach you how to calculate variance.

    In conclusion, calculating variance is a fundamental statistical measure that helps us understand the spread or dispersion of a data set. It provides valuable insights into the variability of the data points and allows us to make meaningful comparisons between different data sets. By following the steps outlined in this guide, we can easily calculate the variance of a set of data points. Understanding and interpreting the variance is essential in various fields such as finance, economics, and research, as it helps us make informed decisions and draw meaningful conclusions. With a clear understanding of the concept and the ability to calculate variance accurately, individuals can analyze data sets more effectively and draw more accurate insights.

    Thank you for reading this post How to Calculate Variance at Tnhelearning.edu.vn You can comment, see more related articles below and hope to help you with interesting information.

    Related Search:

    1. Formula for calculating variance in statistics
    2. Step-by-step guide to calculating variance
    3. Examples of calculating variance with sample data
    4. Variance calculator online
    5. Difference between population variance and sample variance
    6. Importance of calculating variance in data analysis
    7. Common mistakes to avoid when calculating variance
    8. How to interpret variance values in statistical analysis
    9. Variance and standard deviation relationship explained
    10. Real-life applications of variance calculation

    Related Posts

    How to Create Curved Text in Photoshop
    How to fall asleep faster
    How to Install FBReader to Read eBooks

    Category: How To

    Previous Post: « An Incredible Collection of 999+ Vishnu Images in Stunning 4K Resolution
    Next Post: Top 999+ Book Wallpaper Full HD, 4K✅Free to Use »

    Copyright © 2025 · Tnhelearning.edu.vn - Useful Knowledge