Some Useful Things You Can Do in Matrix Algebra.
A. Calculating a Variance/Covariance Matrix.
-
Say you have a correlation matrix, R, and you have the standard deviations for all of the variables. You are interested in computing the Variance/Covariance matrix for these data. This can be given as SRS, where S is a diagonal matrix of standard deviations of the variables (expressed in the same order as they are found in the correlation matrix) and R is the correlation matrix. Here's an example where I number the variables 1, 2, and 3 for ease of presentation:
which is going to give us:
and then
Notice how you see the formula for the respective covariance in each element of this matrix.
B. Make a correlation matrix, given a variance/covariance matrix.
-
Suppose I want to go the other way. All I need to do is pre- and post-multiply by the reciprocal of the standard deviation. For the example above, this would look like:
and I write:
which, spelled out is going to look like:
which, when we do the math, will look like:
and then
which is what we wanted in the first place.
C. Derive the formula for regression weights
1. Given a deviation score or adjoined matrix and using predicted Y's
One way to find formula 6.3 given on page 137 of Pedhazur is to begin with the formula for a predicted Y:
. In order to solve this problem, we'll need to divide somehow in order to get X on the left hand side of the equation. In matrix algebra we can't just divide by X, because as we noted above, X is not square. One way to "make is square" is to premultiply both sides of this equation by
giving us
. Now, X'X gives us a nice square matrix, so we can premultiply both sides of this by the inverse, giving us:
which then gives us:
and recall that Ib=b. Notice that this little exercise in matrix algebra really isn't entirely satisfying, in that I've got the predicted scores of Y on the left hand side of the equation and not Y, but with a little bit of math (or by remembering the definition of predicted scores in Y and their relationship to Y), you can show that the b's are the same in the two formula when taken over all observations in your data set.