askvity

How to Calculate Sum of Squares Example?

Published in Mathematics 2 mins read

Here's how to calculate the sum of squares with an example:

Let's say you have the following data points: 2, 4, 6, and 8. The sum of squares is calculated in a few steps:

  1. Square each data point: This means raising each number to the power of 2.

    • 22 = 4
    • 42 = 16
    • 62 = 36
    • 82 = 64
  2. Sum the squared values: Add up all the results from the previous step.

    • 4 + 16 + 36 + 64 = 120

Therefore, the sum of squares for the data set {2, 4, 6, 8} is 120.

Another, related calculation sometimes confused with "sum of squares" involves calculating the square of the sum of the data points, which is different:

  1. Sum the data points: 2 + 4 + 6 + 8 = 20
  2. Square the sum: 202 = 400

Finally, there's often a calculation (especially in statistics) where you subtract the mean from each data point, square the results, and then sum them. This is closely related to calculating variance. To illustrate, let's use the same dataset {2, 4, 6, 8}:

  1. Calculate the mean (average) of the data: (2 + 4 + 6 + 8) / 4 = 20 / 4 = 5
  2. Subtract the mean from each data point:
    • 2 - 5 = -3
    • 4 - 5 = -1
    • 6 - 5 = 1
    • 8 - 5 = 3
  3. Square each of the results:
    • (-3)2 = 9
    • (-1)2 = 1
    • (1)2 = 1
    • (3)2 = 9
  4. Sum the squared differences: 9 + 1 + 1 + 9 = 20

So, in this case, the sum of squared differences from the mean is 20.

Related Articles