Appendix
The Mechanics of a Multiple
Regression Analysis B
B.1 a. Since A is a 2× 2 matrix and B is a 2× 2 matrix, the product AB will be a 2 × 2 matrix, which
we will call S:
AB = S
⎡ 3 0⎤ ⎡ 2 1⎤ ⎡ s11 s12⎤
⎢ ⎥⎢ ⎥=⎢ ⎥
⎢−1 4⎥ ⎢ 0 −1⎥ ⎢ s 21 s 22⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
To determine the elements of S, the following calculations are required:
s11 = (3)( 2) + (0)(0) = 6
s12 = (3)(1) + (0) (−1) = 3
s21 = (−1) ( 2) + ( 4)(0) = −2
⎡ 6 3⎤
Hence, AB = ⎢ ⎥
⎢−2 −5⎥
⎣ ⎦
⎡ 3 0⎤ ⎡ 1 0 3⎤ ⎡ s11 s12 s13⎤
b. AC = ⎢ ⎥⎢ ⎥=⎢ ⎥
⎢−1 4⎥ ⎢−2 1 2⎥ ⎢ s 21 s 22 s 23⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
where s11 = (3)(1) + (0) (−2) = 3
s12 = (3)(0) + (0)(1) = 0
s13 = (3)(3) + (0)( 2) = 9
s21 = (−1) (1) + (4) (−2) = −9
s22 = (−1) (0) + ( 4)(1) = 4
s23 = (−1) (3) + ( 4)( 2) = 5
⎡ 3 0 9⎤
Hence, AC = ⎢ ⎥
⎢−9 4 5⎥
⎣ ⎦
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall.
,B-2 The Mechanics of a Multiple Regression Analysis
⎡2 1⎤ ⎡ 3 0⎤ ⎡ s11 s12⎤
c. BA = ⎢ ⎥⎢ ⎥= ⎢ ⎥
⎢ 0 −1⎥ ⎢−1 4⎥ ⎢ s 21 s 22⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
s11 = ( 2)(3) + (1) (−1) = 5
s12 = ( 2)(0) + (1)( 4) = 4
s21 = (0)(3) + (−1)(−1) = 1
s22 = (0)(0) + (−1) ( 4) = −4
⎡5 4⎤
Hence, BA = ⎢ ⎥
⎢ 1 −4 ⎥
⎣ ⎦
⎡ 3 1 3⎤ ⎡ 3⎤ ⎡ 3(3) + 1(0) + 3(2) ⎤ ⎡15⎤
⎢ ⎥⎢ ⎥ ⎢ ⎥ ⎢ ⎥
B.2 a. AC = ⎢⎢ 2 0 4⎥⎥ ⎢⎢ 0⎥⎥ = ⎢⎢ 2(3) + 0(0) + 4(2) ⎥⎥ = ⎢⎢14⎥⎥
⎢−4 1 2⎥ ⎢ 2⎥ ⎢−4(3) + 1(0) + 2(2)⎥ ⎢ 8 ⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦ ⎣ ⎦
⎡ 3⎤
⎢ ⎥
b. BC = [1 0 2] ⎢⎢ 0⎥⎥ = [1(3) + 0(0) + 2(2)] = [7 ]
⎢ 2⎥
⎣ ⎦
c. Since A is a 3×3 matrix and B is a 1× 3 , it is not possible to find AB.
B.3 a. If matrix A has dimensions r × d and matrix B has dimensions d × c, then the product matrix
AB has dimensions r × c. In this exercise, r = 3, d = 2, and c = 4 :
A B
3× 2 2× 4
Thus, AB is a 3× 4 matrix.
b. In order to multiply two matrices, the two inner dimension numbers must be equal:
B A
2× 4 3× 2
In this exercise, the number of columns of B (4) does not equal the number of rows of A (3);
thus, the product BA does not exist.
B.4 a. BC is a 1×1 matrix (1× 3)(3×1) ⇒ 1 ⇒ 1
b. CB is a 3× 3 matrix (3×1)(1×3) ⇒ 3× 3
⎡ 3⎤ ⎡ 3(1) 3(0) 3(2) ⎤ ⎡ 3 0 6⎤
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
c. CB = ⎢ 0⎥ [1 0 2] = ⎢⎢ 0(1) 0(0) 0(2)⎥⎥ = ⎢⎢ 0 0 0⎥⎥
⎢ ⎥
⎢ 2⎥ ⎢ 2(1) 2(0) 2(2)⎥ ⎢ 2 0 4⎥
⎣ ⎦ ⎣ ⎦ ⎣ ⎦
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall.
, Appendix B B-3
⎡1 0 0⎤ ⎡ 2 3⎤ ⎡ s11 s12⎤⎥
⎢ ⎥⎢ ⎥ ⎢
B.5 a. AB = ⎢⎢0 3 ⎥ ⎢
0⎥ ⎢−3 0⎥⎥ = ⎢⎢ s 21 s 22⎥⎥
⎢0 0 2⎥⎦ ⎢⎣ 4 −1⎥⎦ ⎢⎣ s 31 s 32⎥⎦
⎣
where s11 = (1)( 2) + (0) (−3) + (0)( 4) = 2
s12 = (1)(3) + (0)(0) + (0) (−1) = 3
s21 = (0)( 2) + (3) (−3) + (0)( 4) = −9
s22 = (0)(3) + (3)(0) + (0) (−1) = 0
s31 = (0)( 2) + (0) (−3) + ( 2)( 4) = 8
s32 = (0)(3) + (0)(0) + ( 2) (−1) = −2
⎡ 2 3⎤
⎢ ⎥
⎢
Hence, AB = ⎢−9 0⎥⎥
⎢ 8 − 2⎥
⎣ ⎦
⎡1 0 0⎤
⎢ ⎥
b. CA = [3 0 2] ⎢⎢ 0 3 0⎥⎥ = [ s11 s12 s13]
⎢0 0 2⎥⎦
⎣
where s11 = (3)(1) + (0)(0) + ( 2)( 0) = 3
s12 = (3)(0) + (0)(3) + ( 2)( 0) = 0
s13 = (3)(0) + (0)(0) + ( 2)( 2) = 4
Thus, CA = [3 0 4]
⎡ 2 3⎤
⎢ ⎥
c. CB = [3 0 2] ⎢⎢ -3 0 ⎥⎥ = [ s 11 s 12 ]
⎢ 4 -1⎥
⎣ ⎦
where s11 = (3)( 2) + (0) (−3) + ( 2)( 4) = 14
s12 = (3)(3) + (0)(0) + ( 2) (−1) = 7
Thus, CB = [14 7]
⎡ 2⎤
⎢ ⎥
⎢−1⎥
B.6 a. AB = [3 0 −1 2] ⎢⎢ ⎥⎥ = [3(2) + 0(−1) + (−1)(0) + 2(3)] = [12]
⎢ 0⎥
⎢ 3⎥
⎢⎣ ⎥⎦
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall.
, B-4 The Mechanics of a Multiple Regression Analysis
⎡ 2⎤ ⎡ 2(3) 2(0) 2(−1) 2(2)⎤ ⎡ 6 0 −2 4⎤
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢−1⎥ ⎢−1(3) −1(0) −1(−1) −1(2)⎥ ⎢−3 0 1 −2⎥⎥
b. ⎢ ⎥ BA = [3 0 −1 2] = ⎢ ⎥=⎢
⎢ 0⎥ ⎢ 0(3) 0(0) 0(− 1) 0(2) ⎥ ⎢ 0 0 0 0⎥⎥
⎢ ⎥ ⎢ ⎥ ⎢
⎢ 3⎥ ⎢ 3(3) 3(−1) 3(2)⎥⎦⎥ ⎢⎣⎢ 9 0 −3 6⎥⎦⎥
⎣⎢ ⎦⎥ ⎣⎢ 3(0)
B.7 a. To obtain the product IA, the number of rows of A (2) must equal the number of columns of I:
I A
2× 2 2×3
An identity matrix is always square, so I will have 2 rows and 2 columns:
⎡ 1 0⎤
I=⎢ ⎥
⎢0 1⎥
⎣ ⎦
⎡1 0⎤ ⎡ 3 0 2⎤ ⎡ 3 0 2⎤
b. IA = ⎢ ⎥⎢ ⎥= ⎢ ⎥=A
⎢0 1⎥⎦ ⎢⎣−1 1 4⎥⎦ ⎢⎣−1 1 4⎥⎦
⎣
c. To find the product AI, the number of rows and columns of I must equal the number of columns
of A(3):
A I
2×3 3×3
Hence, I is the 3× 3 identity matrix.
⎡1 0 0⎤
⎢ ⎥
I = ⎢⎢0 1 0⎥⎥
⎢0 0 1⎥⎦
⎣
⎡1 0 0⎤
⎡ 3 0 2⎤ ⎢ ⎥ ⎡ 3 0 2⎤
d. AI = ⎢ ⎥ ⎢0 1 0⎥⎥ = ⎢ ⎥=A
⎢−1
⎣ 1 4⎥⎦ ⎢⎢ ⎢−1 1 4⎥⎦
⎣0 0 1⎥⎦ ⎣
⎡ ⎤
⎢ ⎥
⎡1 0 0⎤ ⎢1 0 0⎥
⎢ ⎥ ⎢ ⎥ ⎡⎢1 0 0⎤⎥
⎢ 1 ⎥
B.8 AB = ⎢⎢0 2 0⎥⎥ ⎢0 0 ⎥ = ⎢⎢0 1 0⎥⎥
⎢ 0 0 3⎥ ⎢ 2 ⎥ ⎢
⎢ 0 0 1⎥⎦
⎣ ⎦ ⎢0 1 ⎥⎥ ⎣
⎢ 0 ⎥
⎣ 3⎦
⎡ ⎤
⎢ ⎥
⎢1 0 0⎥
⎡ 1 0 0⎤ ⎡ 1 0 0⎤
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ 1 ⎥ ⎢ ⎥ ⎢ ⎥
BA = ⎢ 0 0⎥ ⎢ 0 2 0⎥ = ⎢ 0 1 0⎥
⎢ 2 ⎥ ⎢ 0 0 3⎥ ⎢0 0 1⎥
⎢ 1 ⎥⎥ ⎣ ⎦ ⎣ ⎦
⎢0 0
⎢ ⎥
⎣ 3⎦
Since AB = I = BA ⇒ A = B−1 and B = A -1
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall.