Calculate the mean, or average, of the first variable, x. Add all the data points and then divide by the number of data points. For example, if you have the data set {1, 3, 3, 5} for x, the mean is (1 + 3 + 3 + 5) / 4 = 3.
Calculate the mean for the second variable, y, the same way. Suppose you have the data set {12, 12, 11, 7} for y. The mean is (12 + 12 + 11 + 7) / 4 = 10.5.
Multiply each data point for x by the corresponding data point for y. For example, for these two data sets, you would calculate {12 x 1, 12 x 3, 11 x 3, 7 x 5} = {12, 36, 33, 35}.
Calculate the mean of the data set you just created. This is the E{xy}. Continuing the example: (12 + 36 + 33 +35) / 4 = 29.
Calculate E{x}E{y} by multiplying the mean of x and the mean of y you calculated earlier. In our example, that's 3 x 10.5 = 31.5.
Calculate the covariance by using the equation Cov(x,y) = E{xy} - E{x}E{y}. Finishing the example, 29 - 31.5 = -2.5. This is a negative covariance, indicating that in general, as one variable increases, the other decreases.