This lesson explains how to use matrix methods to compute the means of vector elements and the means of matrix columns.
Mean Scores: Vectors
In ordinary algebra, the mean of a set of observations is computed by adding all of the observations and dividing by the number of
observations.
x = Σxi / n
where x is the mean of observations, Σxi is the sum of all observations, and n is the number of observations.
In matrix algebra, the mean of a set of n scores can be computed as follows:
x = 1'x ( 1'1 )-1 = 1'x ( 1/n )
where
x is the mean of a set of n scores
1 is an n x 1 column vector of ones
x is an n x 1 column vector of scores: x1, x2, . . . , xn
To show how this works, let's find the mean of elements of vector x, where x' = [ 1 2 3 ].
x = 1'x(1'1 )-1
1 1
x = [111] 2 ( [111] 1 )-1
3 1
x = 6/3 = 2
Thus, the mean of the elements of x is 2.
Mean Scores: Matrices
You can think of an r x c matrix as a set of c column vectors, each having r elements. Often, with matrices, we want to compute mean
scores separately within columns, consistent with the equation below.
Xc = Σ Xic / r
where
Xc is the mean of a set of r scores from column c
Σ Xic is the sum of elements from column c
In matrix algebra, a vector of mean scores from each column of matrix X can be computed as follows:
m' = 1'X ( 1'1 )-1 = 1'X ( 1/r )
where