Statistics 2080B: Practice Problems - Matrices
Practice P

A2.
 A2.	 MATRIX A	MATRIX B      MATRIX C
  	 3   1   3 	1   0   2	3
  	 2   0   4 			0
        -4   1   2 			2
 
 	a)  MATRIX AC	
 	       15 			
  	       14 
  	       -8 




	b)  MATRIX BC
		7
c) No, it is not possible to find the product AB since the number of columns in A(3) does not equal the number of rows in B(1).


A3.

a) AB is a 3 x 4 matrix
b) No, it is not possible to find the product BA because the number of columns in B(4) does not equal the number of rows in A(3).


A4.

a) BC has dimensions $1 \times 1$

b) CB has dimensions $3 \times 3$

c)
	     MATRIX CB
  	       3   0   6 
  	       0   0   0 
  	       2   0   4


A7.

	 
	 A =   3   0   2
	      -1   1   4
a) The identity matrix used to get the product IA is $2 \times 2$.

		I = 1  0
		    0  1

c) The identity matrix used to get the product AI is $3 \times 3$

			1  0  0
		I = 	0  1  0
                        0  0  1


A8.

Since AB = I and BA = I then B is the inverse of A

  
	AB = BA = I =   1   0   0 
   			0   1   0 
  		        0   0   1


A18.

a) Y has dimensions $10 \times 1$

X has dimensions $10 \times 3$

b)

        X'X [X'X]-1 = I  I = 1  0  0 
			     0  1  0
			     0  0  1

c) A matrix A is symmetric if aij = aji for all i and j.
d)

 MTB > read 10 x 3 m20  M20 = X  X has dimensions 10 x 3
 DATA> 1 -2 4
 DATA> 1 -2 4
 DATA> 1 -1 1
 DATA> 1 -1 1
 DATA> 1 0 0
 DATA> 1 0 0
 DATA> 1 1 1
 DATA> 1 1 1
 DATA> 1 2 4
 DATA> 1 2 4
      10 ROWS READ
 MTB > trans m20 m21
 MTB > print m21
  MATRIX M21       M21 = X'  X' has dimensions 3 x 10
  
   1   1   1   1   1   1   1   1   1   1 
  -2  -2  -1  -1   0   0   1   1   2   2 
   4   4   1   1   0   0   1   1   4   4 
 
 
 MTB > mult m21 m20 m22   
 MTB > print m22

    MATRIX M22	  M22 = X'X	X'X has dimensions  3 x 3
  
   10    0   20 
    0   20    0 
   20    0   68 
 
 
 MTB > invert m22 m23
 MTB > print m23
 
	 MATRIX M23     M23 = [X'X]-1    [X'X] -1 has dimensions 3x3
 
  0.242857  0.000000 -0.071429 
  0.000000  0.050000  0.000000 
 -0.071429  0.000000  0.035714 
 
 
 MTB > read 10 x 1 m24  M24 = Y  Y has dimensions 10 x 1
 DATA> 1.1
 DATA> 1.3
 DATA> 2.0
 DATA> 2.1
 DATA> 2.7
 DATA> 2.8
 DATA> 3.4
 DATA> 3.6
 DATA> 4.1
 DATA> 4.0
      10 ROWS READ
 
 MTB > mult m21 m24 m25
 MTB > print m25
  MATRIX M25    M25 = X'Y  X'Y has dimensions 3 x 1
  
   27.1 
   14.3 
   53.1 
 
 
 MTB > mult m23 m25 m26
 MTB > print m26
  MATRIX M26	M26 = [X'X]-1X'Y	[X'X]-1X'Y has dimensions 3 x 1

$M_{26} = [X'X] - X'Y = \hat{\beta}$

$\hat{\beta}_{i} = 2.78857$ $\hat{\beta}_{1} = 0.71500$

$\hat{\beta}_{2} = -0.03929$ The least squares equation is $\hat{y} = 2.78857 + 0.715x - 0.03929x^{2}$


A21.

MTB > mult m20 m26 m27     M20 = X  M26= beta (hat) so M27 = Y(hat)
 MTB > print m27
  MATRIX M27
  
   1.20143 
   1.20143 
   2.03429 
   2.03429 
   2.78857 
   2.78857 
   3.46429 
   3.46429 
   4.06143 
   4.06143 
 
 
 MTB > copy m24 c1		c1 = yi
 MTB > copy m27 c2		c2 = yi(hat)
 MTB > let c3 = c1 - c2 	c3 = ei = residuals
 MTB > let c4 = c3**2
 MTB > sum c4
    SUM     =    0.061286  SSE = .061286

$\hat{y} = 3.46429$ when x = 1

$s = \sqrt{\frac{SSE}{n-(k+1)}} = \sqrt{\frac{0.061286}{10 - 3}} = 0.09357$

V22 = 0.357

$s_{\hat{\beta_{2}}} = s\sqrt{V_{22}} = 0.9357\sqrt{0.035714} = 0.01768$

$H_{0}: \ \ \ B_{2} = 0$

$H_{A}: \ \ \ B_{2} \neq 0$

$t = \frac{-0.03929}{0.01768} = -2.22$

t has 7 df

0.05 < p < 0.10

Reject the null hypothesis at $\alpha = 0.10$ since the p-value is less than $\alpha$. The data indicates curvature.


A.26

  MATRIX M30	M30 = l
  
   1 
   1 
   1 
 
 
 MTB > trans m30 m31
 MTB > mult m31 m23 m32
 MTB > mult m32 m30 m33
 ANSWER =         0.1857
 
MTB > copy m20 c10 c11 c12
 MTB > print c10-c12
 
  ROW   C10   C11   C12
 
    1     1    -2     4
    2     1    -2     4
    3     1    -1     1
    4     1    -1     1
    5     1     0     0
    6     1     0     0
    7     1     1     1
    8     1     1     1
    9     1     2     4
   10     1     2     4
 
 MTB > regress c1 on 2 in c11 c12;
 SUBC> predict 1 1.
 
 The regression equation is
 C1 = 2.79 + 0.715 C11 - 0.0393 C12
 
 Predictor       Coef       Stdev    t-ratio        p
 Constant     2.78857     0.04611      60.48    0.000
 C11          0.71500     0.02092      34.17    0.000
 C12         -0.03929     0.01768      -2.22    0.062
 
 s = 0.09357     R-sq = 99.4%     R-sq(adj) = 99.2%
 
 Analysis of Variance
 
 SOURCE       DF          SS          MS         F        p
 Regression    2     10.2677      5.1339    586.39    0.000
 Error         7      0.0613      0.0088
 Total         9     10.3290
 
 SOURCE       DF      SEQ SS
 C11           1     10.2245
 C12           1      0.0432
 
 
      Fit  Stdev.Fit         95% C.I.         95% P.I.
   3.4643     0.0403   ( 3.3689, 3.5597)  ( 3.2233, 3.7053)

The $90\%$ confidence interval for E[y] when x=1, $\hat{y} = 3.46429$, s = 0.09357, and l'(x'x)-1l = 0.1857.

t has 7 df, t=1.895

$3.46429 \pm 1.895(0.09357)\sqrt{0.1857}$

(3.36,3.51)


A.27

$90\%$ prediction interval for a new value of y when x=1

$\hat{y}, \ s, \ t, \ l'(x'x)^{-1}l$ the same as in A.26

$3.46429 \pm 1.895(0.09357)\sqrt{1.1857}$

(3.27,3.66)


A.28

a) $n=25, \ SSE = 26.62, \ K = 2, \ k + 1 = 3, \ n - (k + 1) = 25 - 3 = 22$

$s^{2} = \frac{SSE}{n-(k+1)} = \frac{26.62}{25-3} = 1.21$

s = 1.1

b) $95\%$ confidence interval for E[y] when x=1.10, x2 = 1.21

$\hat{y} = 2.08 + 8.42(1.1) - 1.65(1.21) = 9.346$

$l = \left(\begin{array}{c}
1 \\
1.1 \\
1.21
\end{array}\right)$

l'(x'x)-1l = 0.1077

t has 22 df, t = 2.074

$\hat{y} \pm ts\sqrt{l'(x'x)^{-1}l}$

$9.346 \pm 2.074(1.1)\sqrt{0.1077}$

$9.346 \pm 0.749$

(8.60,10.10)

We are $95\%$ confident that the mean number of items produced per hour per worker when the piece rate, $\$1.10$, is between 8.6 and 10.10 items/hour/worker.

c) $95\%$ prediction interval for individual worker who is paid $\$1.10$ per piece.

$\hat{y} \pm ts\sqrt{l'(x'x)^{-1}l}$

$9.346 \pm 2.074(1.1)\sqrt{1.1077}$

$9.346 \pm 2.401$

(6.945,11.747)

We are $95\%$ confident that if a worker is paid a piecework rate of $\$1.10$ per piece his productivity will be between 6,95 and 11.75.

d) SSE = 26.26

$SST = 784.11 \Rightarrow SSR = 757.49$

$R^{2} = \frac{SSR}{SST} = \frac{757.49}{784.11} = 96.6\%$

$96.6\%$ of the valuability is explained by the regression model.


STATISTICS 2080 HOMEPAGE


Jonathan Payne
1999-03-11