help mata mm_nobs()
-------------------------------------------------------------------------------

Title

mm_nobs() -- number of observations

Syntax

real scalar mm_nobs(transmorphic matrix X, real colvector w)

Description

mm_nobs() determines the number of observations from given data and weights. Essentially, mm_nobs() is a shortcut to

rows(w)==1 ? rows(X)*w : colsum(w)

Remarks

None.

Conformability

mm_nobs(X) X: r x c w: r x 1 or 1 x 1 result: 1 x 1

Diagnostics

w should be non-missing and non-negative.

Source code

mm_nobs.mata

Author

Ben Jann, ETH Zurich, jann@soz.gess.ethz.ch

Also see

Online: help for moremata