Weighted Standard Deviation Calculator

Enter values and matching weights to find the weighted standard deviation.

How it is calculated

You enter a list of values xi and a list of weights wi of the same length, separated by commas or spaces. The weighted mean is x̄w = Σ wixi ÷ Σ wi. The weighted standard deviation is the sample form of NIST's Dataplot manual: sw = √( Σ wi(xi − x̄w)² ÷ ((N′ − 1) × Σ wi ÷ N′) ), where N′ is the number of non-zero weights. The population form, √( Σ wi(xi − x̄w)² ÷ Σ wi ) (OpenStax's standard deviation with frequencies), is shown beside it, labeled. With fewer than two non-zero weights the sample form is not defined. The two lists must have equal length, no weight may be negative, and the weights must add up to more than zero; otherwise there is no result. A weight of 0 simply removes that value from the calculation, and with all weights equal the two forms are the ordinary sample and population standard deviations.

Worked example

Values 70, 80, 90 with weights 1, 2, 3. The weights add up to 6. Weighted mean: (1×70 + 2×80 + 3×90) ÷ 6 = 500 ÷ 6 = 83.33. Deviations squared and weighted: 1×(70 − 83.33)² = 177.78, 2×(80 − 83.33)² = 22.22, 3×(90 − 83.33)² = 133.33, total 333.33. All three weights are non-zero, so N′ = 3 and NIST's sample form divides by (N′ − 1) × Σw ÷ N′ = 2 × 6 ÷ 3 = 4: √(333.33 ÷ 4) = √83.33 = 9.13. Result: weighted standard deviation 9.13 around a weighted mean of 83.33. The population form divides by the sum of the weights: √(333.33 ÷ 6) = √55.56 = 7.45.

Try this example →

Common mistakes

  • Giving a different number of weights than values. Every value needs exactly one weight, and a mismatch returns no result.
  • Using percentages and expecting them to matter. Weights of 10, 20, 30 and 1, 2, 3 give the same answer, because only the ratios between weights count.
  • Comparing with the wrong form. The main figure is NIST's sample form; a reference that divides by the sum of the weights matches the population form shown beside it.
  • Entering a negative weight to mean less trust. A weight must be zero or positive; a negative one is rejected and shows no result, as do weights that are all zero.
  • Separating numbers with a decimal comma, such as 2,5, inside the list. The comma separates items, so write 2.5 for a decimal.

Sources

About this calculator

The weighted standard deviation measures spread around a weighted mean rather than a plain average, giving each data point influence in proportion to a weight you assign it, a reliability score, sample size, or measurement precision, instead of treating every value as equally trustworthy.

This matters whenever the data points being combined aren't equally reliable: meta-analyses in research combine results from studies of different sizes by weighting larger, more precise studies more heavily; survey analysts weight responses to correct for over- or under-sampled demographic groups; and lab scientists combine repeated measurements with different precisions using weights based on their measurement uncertainty. Using an unweighted standard deviation in these cases would let noisy or unreliable data points distort the result just as much as trustworthy ones.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators