**Statistical Calculations: Variance, Standard Deviation, and Correlation**

Three basic statistical measures which I use quite a bit are variance, standard deviation, and correlation.Basic Formulas

Variance measures the average squared difference between a series and the mean of the series. It measures the spread of a series. If a series is normally distributed, approximately 65% of all observations will fall within one standard deviation of the mean of the series, 95% of all observations will fall within two standard deviations of the mean of the series, and 99% of all observations will fall within three standard deviations.

The conventional formula for the variance of a series, x

Var(x) = SUM_{i=1}^{N}(x_{i} – m)^{2}/(N-1)

Correlation is a measure of how closely related two series are. Correlation, often identified by the letter r, takes on a value between 1 and -1. A correlation of 1 indicates that the two series, call them x

The conventional formula for the correlation of series x

r_{12} = {SUM(x_{1} – m_{1})·(x_{2} – m_{2})} / sqrt{SUM(x_{1} – m_{1})^{2}·SUM(x_{2} – m_{2})^{2}}

The basic formulas for variance, standard deviation, and correlation shown above assume that every observation of a series is equal. In many, perhaps most, cases, this is a perfectly reasonable assumption. In the case of my work, however, when the observations are winning percentages (or wins, or any other measure, really) by players, this is not a reasonable assumption. In such a case, one should, instead, weight each player’s total by the total number of Player decisions accumulated by that player. This is actually quite easily done.Weighted Variance and Standard Deviation

The formula for variance above in effect already takes a weighted average of (x

Var(x) = SUM_{i=1}^{N} g_{i}·(x_{i} – m)^{2}/G

As with variance, the basic formula for correlation treats each observation of the two series, xWeighted Correlation

r_{12} = {SUM(1/(N-1))·(x_{1} – m_{1})·(x_{2} – m_{2})} / sqrt{SUM(1/(N-1))·(x_{1} – m_{1})^{2}·SUM(1/(N-1))·(x_{2} – m_{2})^{2}}

r_{12} = {SUM(g_{i}/G)·(x_{1} – m_{1})·(x_{2} – m_{2})} / sqrt{SUM(g_{i}/G)·(x_{1} – m_{1})^{2}·SUM(g_{i}/G)·(x_{2} – m_{2})^{2}}