Advertisement

Sum of squares calculator

Keep raw square totals separate from squared deviations around the mean. Paired mode also measures the difference between matching observations.

Calculator

Raw sum of X squares
14.000000
Mean-corrected X sum of squares
2.000000
Mean of X
2.000000
Matched observation count
3

Advertisement

How this calculator works

Raw sum of squares adds squared observations without moving the origin. A corrected sum of squares instead centres observations on their own mean and measures spread. The implementation uses centred differences directly, avoiding subtraction of two large, nearly equal raw totals. Paired mode additionally returns the centred cross-product used in covariance and the sum of squared differences between supplied pairs. The latter becomes a residual sum of squares only when one list contains observations and the other the corresponding predictions.

Formula

Raw SS = sum(x_i²). Corrected SS = sum[(x_i - mean X)²]. Cross-product = sum[(x_i - mean X)(y_i - mean Y)]. Paired difference SS = sum[(x_i - y_i)²].

Worked example

For 1, 2, 3, raw SS is 1 + 4 + 9 = 14 and corrected SS is 1 + 0 + 1 = 2. For matched X = 1, 3 and Y = 2, 6, corrected totals are 2 and 8, the cross-product is 4 and squared differences total 10.

Advertisement

Frequently asked questions

Which sum belongs in sample variance?

Use corrected SS, then divide by n - 1. Raw SS generally includes a contribution from the mean.

Can X and Y have different lengths?

No. Paired calculations require a one-to-one correspondence between observations.

What units do sums of squares use?

A squared total uses the square of its observation unit. A cross-product uses X units times Y units.

Sources

Advertisement