This lesson introduces the sums of squares and cross products matrix (aka, SSCP matrix). We show how to use matrix methods to
compute the SSCP matrix, using both raw scores and deviation scores.
Sum of Squares: Vectors
In statistics, many formulas require the calculation of sums of squares; i.e., squaring all of the elements in a set and then taking the su
of those squares.
Using matrix algebra, the sum of squares for all the elements of a vector is calculated according to the following formula:
Σ xi2 = x'x
where
x is an n x 1 column vector of scores: x1, x2, . . . , xn
Σ xi2 is the sum of the squared values from vector x
To illustrate, let's find the sum of squares for the elements of vector x, where x' = [ 1 2 3 ].
1
Σ xi2 = [ 1 2 3 ] 2
3
x' x
Σ xi2 = ( 1 * 1 ) + ( 2 * 2 ) + ( 3 * 3 )
Σ xi2 = 1 + 4 + 9 = 14
Thus, the sum of the squared elements from vector x is 14.
Sums of Squares and Cross Products: Matrices
With matrices, we can compute not only sums of squares but also sums of cross products. For an r x c matrix, an individual cross
product is represented by XrjXrk. The sum of cross products between all the elements of columns j and k is represented by Σ XrjXrk,
summed over r. A matrix of sums of squares and sums of cross products is represented by X' X, as shown below.
Σ X 12 Σ X1 X2 ... Σ X1 Xc
Σ X2 X1 Σ X 22 ... Σ X2 Xc
X' X =
... ... ... ...
Σ Xc X1 Σ Xc X2 ... Σ X c2
where
X is an r x c matrix of raw scores: X11, X12, . . . , Xrc
X' X is a c x c matrix of sums of squares and sums of cross products
Σ Xi2 is the sum of the square of all elements in column i of matrix X