CCalclabhub

Statistics

Sample covariance

Use when the pairs are a sample from a larger population. Dividing by n minus one corrects the tendency of deviations measured around a fitted sample mean to be too small.

Last updated

The Formula

sXY = Sum((xi - x-bar)(yi - y-bar)) / (n - 1)

Use when the pairs are a sample from a larger population. Dividing by n minus one corrects the tendency of deviations measured around a fitted sample mean to be too small.

SymbolMeaning
sXYSample covariance
x-bar, y-barThe two sample means
nSample size

What Each Symbol Means

sXYx units times y units

Sample covariance

An unbiased estimate of the population covariance; 1.5 for the worked pairs.

x-bar, y-barsame as each variable

The two sample means

Averages calculated from the sampled pairs themselves.

ncount

Sample size

With five pairs the divisor becomes four, giving a larger answer than the population form.

See It Worked With Real Numbers

A formula on its own does not tell you which number goes where. The how to calculate the covariance page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.

Where This Formula Appears

This equation is the working core of How To Calculate The Covariance, filed under Math. Every number the guide produces comes from substituting into this one line.

Common Questions

What is the formula for Sample covariance?

The formula for Sample covariance is sXY = Sum((xi - x-bar)(yi - y-bar)) / (n - 1). Use when the pairs are a sample from a larger population. Dividing by n minus one corrects the tendency of deviations measured around a fitted sample mean to be too small.

What does each symbol in Sample covariance stand for?

sXY is sample covariance; x-bar, y-bar is the two sample means; n is sample size.

What units should I use with Sample covariance?

Substitute sXY in x units times y units, x-bar, y-bar in same as each variable, n as a plain count. Convert every input to those units before you start, because the equation only returns the right answer when the units on both sides agree.

What is a common mistake when using Sample covariance?

Multiplying raw values instead of deviations. Covariance compares each value with its own variable's mean. Multiplying x and y directly and averaging the products measures something quite different and depends heavily on where zero sits. Always subtract the two means before forming the cross-products.