Can someone provide an example of a covariance matrix for any set of data? For example, if given:
2 3 4
5 1 8
9 7 6
how would I take this 3x3 matrix and convert it to the covariance matrix? I see the formula involves taking the means, but I'm not quite sure how that works in this case...
Here is a session from R statistical software with means and variances of three variables similar to yours, and then a variance-covariance matrix of all three.
Notice that the variance $1$ of data vector $x_1$ is in the upper-left corner of the variance-covariance matrix. And that the other two variances 12.3333 and 4 are also on the principal diagonal of the matrix.
The covariance of $x_1$ and $x_3$ is computed as $$S_{13} = \frac{(2-3)(9-7)+(3-3)(7-7)+(4-3)(5-7)}{2} = \frac{-2+0-2}{2} -4/2 = -2,$$ which is shown at the top of right-hand column of the variance-covariance matrix. (Also again, at the left of the bottom row.)
You do not show the formula for the covariance as given in your book so I have shown the arithmetic without trying to guess the notation. I will leave it to you to match my arithmetic with the formula in your book.