Weighted Variance Calculator
Weighted variance with frequency weights, both sample and population divisors, plus the weighted mean.
What this page computes
Type the values and their frequency weights as two comma-separated lists. The weighted mean is Σwx / Σw; the weighted sum of squares is Σw(x − x̄w)²; and the page divides it by Σw − 1 for the sample form and by Σw for the population form, printing both divisors. The Bessel correction is on the effective count, not the number of pairs. Figures print to six significant figures.
The weights are frequency weights: a value with weight 3 counts as three observations. They are not analytic weights or probability weights, and the page does not pretend to correct the standard error for a complex survey. A weight at or below zero is refused, and so is a weight total at or below 1, since Σw − 1 would be zero.
The arithmetic runs in this tab, so the same lists always print the same two variances.
The page computes a weighted variance around the weighted mean: Σw(x − x̄_w)² divided by Σw − 1 for the sample form and by Σw for the population form. Values 80, 90 and 70 with weights 1, 2 and 1 give 91.6667 and 68.75 from Σw(x − x̄_w)² = 275 over Σw = 4. Both divisors are printed, and a weight of zero or below is refused rather than dropping a value.
Get weighted sample and population variance from two comma-separated lists, with both divisors named.
How to use it
Type the values as a comma-separated list and the weights the same way; the lists must be the same length. Every weight must be above zero. The sample form needs Σw above 1, because Σw − 1 would otherwise be zero or negative, and the page refuses that case by naming the sum.
The weighted centre and the Σw − 1 divisor
The centre is the weighted mean rather than the plain one, so this is not the same as weighting a set of already-computed variances — the deviations are taken from x̄_w first. The sample divisor is Σw − 1 and the population divisor is Σw, which mirrors the unweighted page where weights are all 1 and the two become n − 1 and n. The printed Σw(x − x̄_w)² and Σw let the division be checked by hand.
What to Expect
Best for
- Spread of values that do not all count equally
What this tool keeps
- Nothing leaves this tab: the arithmetic runs in the page you are reading, and a reload discards both the input and the result.
Sample output
weighted mean = 82.5 weighted sample variance = 91.6667 (divisor Σw − 1 = 3) weighted population variance = 68.75 (divisor Σw = 4) Σw(x − x̄_w)² = 275, Σw = 4 n = 3 values
Frequently asked questions
Which divisor does each line use?
The sample line divides by Σw − 1 and the population line by Σw, and both are printed with their value. With weights 1, 2 and 1, Σw is 4, so the divisors are 3 and 4.
Why is Σw − 1 required to be above zero?
Because the sample variance divides by it. A set of weights summing to 1 or less would make the divisor zero or negative, so the page refuses that case and names the sum.
Is anything uploaded?
No. The weighted centre, both sums and both variances are computed in this page, and nothing is posted or stored.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.