Missing values in matrices are discussed in Chapter 3: Understanding the SAS/IML Language. You should carefully read that chapter and Chapter 23: Further Notes, so that you are aware of the way SAS/IML software handles missing values. The following examples show how missing values are handled for elementwise operations and for subscript reduction operators.
Consider the following two matrices
and
:
![\[ \mb {X} = \left[ \begin{array}{ccc} 1 & 2 & . \\ . & 5 & 6 \\ 7 & . & 9 \\ \end{array} \right] \mb {Y} = \left[ \begin{array}{ccc} 4 & . & 2 \\ 2 & 1 & 3 \\ 6 & . & 5 \\ \end{array} \right] \]](images/imlug_workmatrix0067.png)
The following operations handle missing values in matrices:
![\[ \mbox{Matrix addition:~ } \mb {X} +\mb {Y} \mbox{ is } \left[ \begin{array}{ccc} 5 & . & . \\ . & 6 & 9 \\ 13 & . & 14 \\ \end{array} \right] \]](images/imlug_workmatrix0068.png)
![\[ \mbox{Elementwise multiplication:~ } \mb {X} \# \mb {Y} \mbox{ is } \left[ \begin{array}{ccc} 4 & . & . \\ . & 5 & 18 \\ 42 & . & 45 \\ \end{array} \right] \]](images/imlug_workmatrix0069.png)