Title
mm_colrunsum() -- Running sum of each column
Syntax
numeric matrix mm_colrunsum(real matrix Z)
Description
mm_colrunsum() returns a matrix containing the running sum over each column of Z. Missing values are treated as zero.
Remarks
mm_colrunsum() was written for Stata 9 and predates the release of official Stata's runningsum() function in Stata 10. Changes have been made to mm_colrunsum() so that it redirects itself to runningsum() if used in Stata 10.
Conformability
mm_colrunsum(Z): Z: r x c result: r x c
Diagnostics
mm_colrunsum() treats missing values as contributing zero to the running sum; they do not cause the running sum to become missing.
Source code
mm_colrunsum.mata
Author
Ben Jann, ETH Zurich, jann@soz.gess.ethz.ch
Also see