Previous Page | Next Page

Language Reference

COUNTMISS Function

COUNTMISS( x <, method> ) ;

The COUNTMISS function counts the number of missing values in a matrix. The arguments are as follows:

x

specifies an numerical or character matrix. The COUNTMISS function counts the number of missing values in this matrix.

method

specifies the method used to count the missing values. This argument is optional. The following are valid values:

"all"

specifies that all missing values are counted. This is the default value. The function returns a matrix.

"row"

specifies that the function return an matrix whose th element is the number of missing values in the th row of x.

"col"

specifies that the function return a matrix whose th element is the number of missing values in the th row of x.

The method argument is not case-sensitive. The first three characters are used to determine the value.

For example, the following statements count missing values for the matrix x:

x = {1 2 3,
     . 0 2, 
     1 . .,
     1 0 . };
totalMiss = countmiss(x);
rowMiss = countmiss(x, "ROW");
colMiss = countmiss(x, "COL");
print totalMiss, rowMiss, colMiss;

Figure 23.64 Counts of Missing Values
totalMiss
4

rowMiss
0
1
2
1

colMiss
1 1 2

Previous Page | Next Page | Top of Page