Tests to see if its argument is a scalar missing value.
Parameters: x (NxK matrix) – data Returns: y (scalar) – 1 if argument is a scalar missing value, 0 if not.
clear s; do until eof(fp); y = readr(fp, r); y = packr(y); if scalmiss(y); continue; endif; s = s +s umc(y); endo;
In this example the
packr() function will return a scalar missing if
every row of its argument contains missing values, otherwise it will
return a matrix that contains no missing values.
scalmiss() is used
here to test for a scalar missing returned from
packr(). If the test returns
true, then the sum step will be skipped for that iteration of the
read loop because there were no rows left after the rows containing
missings were packed out.
To test whether any element of a matrix is a missing value, use
scalmiss() will execute much faster if the argument is a large matrix,
since it will not test each element of the matrix but will simply return
An element of x is considered to be a missing if and only if it contains
a missing value in the real part. Thus,
return a 1 for complex \(x = . + 1i\), and a 0 for \(x = 1 + .i\).