COUNTMISS (x <, method> );
The COUNTMISS function counts the number of missing values in a matrix. The arguments are as follows:
specifies an numerical or character matrix. The COUNTMISS function counts the number of missing values in this matrix.
specifies the method used to count the missing values. This argument is optional. The following are valid values:
specifies that all missing values are counted. This is the default value. The function returns a matrix.
specifies that the function return an matrix whose ith element is the number of missing values in the ith row of x.
specifies that the function return a matrix whose jth element is the number of missing values in the jth 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;