Calculator
Example data table
| # | X | Y | Weight |
|---|---|---|---|
| 1 | 10 | 12 | 1 |
| 2 | 12 | 14 | 0.8 |
| 3 | 13 | 13 | 1.2 |
| 4 | 15 | 18 | 1 |
| 5 | 16 | 17 | 0.6 |
Tip: click “Load example” to paste these values into the calculator.
Formula used
Let pairs be (xᵢ, yᵢ) with weights wᵢ > 0. Weighted means are:
The weighted covariance numerator is:
This calculator offers three normalizations:
- Population: cov = Sₓᵧ / (Σ wᵢ)
- Unbiased-like: cov = Sₓᵧ / (Σ wᵢ − Σ wᵢ² / Σ wᵢ)
- Frequency weights: cov = Sₓᵧ / (Σ wᵢ − 1)
Weighted correlation is computed as corr = cov / (σₓ σᵧ), where σ values come from weighted variances using the same normalization.
How to use this calculator
- Paste rows as x,y,weight or upload a CSV file.
- Select the delimiter and whether the first row is a header.
- Pick a normalization method that matches your weights.
- Set precision, choose invalid row handling, then calculate.
- Download CSV or PDF exports from the results card.
FAQs
1) What does weighted covariance measure?
It measures how two variables change together when observations have different importance. Higher weights pull the result toward those observations more strongly.
2) When should I use the population method?
Use it when your weights represent proportions or importance and you want the covariance of the weighted dataset itself, not an unbiased estimate of a larger process.
3) What is the “unbiased-like” correction doing?
It adjusts the denominator using Σw − Σw²/Σw, which accounts for uneven weights. This often behaves like an unbiased estimator when weights reflect measurement reliability.
4) When are frequency weights appropriate?
Use frequency weights when each row represents repeated identical observations. In that case Σw acts like sample size, and Σw − 1 matches a Bessel-style correction.
5) Why must weights be greater than zero?
Zero or negative weights can break interpretation and can create invalid denominators. Positive weights ensure a meaningful weighted mean and stable normalization.
6) What happens to invalid or missing rows?
You can skip them or stop on the first error. Skipping is useful for messy inputs; stopping is better when you need strict validation.
7) Does the calculator compute correlation too?
Yes. It computes weighted variances and standard deviations using the same normalization, then returns corr = cov / (σₓ σᵧ) when both σ values are positive.
8) What is effective sample size (N_eff)?
N_eff = (Σw)² / Σw² summarizes how concentrated the weights are. If a few rows dominate, N_eff drops, indicating less independent information than the raw row count.