Stata 15 help for mf_missing

[M-5] missing() -- Count missing and nonmissing values

Syntax

real rowvector colmissing(numeric matrix X)

real colvector rowmissing(numeric matrix X)

real scalar missing(numeric matrix X)

real rowvector colnonmissing(numeric matrix X)

real colvector rownonmissing(numeric matrix X)

real scalar nonmissing(numeric matrix X)

real scalar hasmissing(numeric matrix X)

Description

These functions return the indicated count of missing or nonmissing values.

colmissing(X) returns the count of missing values of each column of X, rowmissing(X) returns the count of missing values of each row, and missing(X) returns the overall count.

colnonmissing(X) returns the count of nonmissing values of each column of X, rownonmissing(X) returns the count of nonmissing values of each row, and nonmissing(X) returns the overall count.

hasmissing(X) returns 1 if X has a missing value or 0 if X does not have a missing value.

Remarks

colnonmissing(X) = rows(X) :- colmissing(X)

rownonmissing(X) = cols(X) :- rowmissing(X)

nonmissing(X) = rows(X)*cols(X) - missing(X)

Conformability

colmissing(X), colnonmissing(X): X: r x c result: 1 x c

rowmissing(X), rownonmissing(X): X: r x c result: r x 1

missing(X), nonmissing(X), hasmissing(X): X: r x c result: 1 x 1

Diagnostics

None.

Source code

Functions are built in.


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index