![Compute 2-D cumulative sums and ogives](https://blogs.sas.com/content/iml/files/2021/06/ogive2d3-640x336.png)
A recent article about how to estimate a two-dimensional distribution function in SAS inspired me to think about a related computation: a 2-D cumulative sum. Suppose you have numbers in a matrix, X. A 2-D cumulative sum is a second matrix, C, such that the C[p,q] gives the sum of