Let's denote the first trait as $X$ and the second trait as $Y$. The covariance is given by the formula:
$$Cov(X,Y) = \frac{\sum_{i=1}^{n}(X_i - \bar{X})(Y_i - \bar{Y})}{n-1}$$
where $X_i$ and $Y_i$ are the individual measurements, $\bar{X}$ and $\bar{Y}$ are
Show more…