Hi,
Using the code below, I am trying to calculate the cumulated frequency at age x and above it. However, the code generated missings for each age. How can I fix this? The code below is supposed to accumulate from the bottom up, which subtracts a running sum from the total.
Thanks,
NM

Code:
gen  T = r(sum) - sum(L) + L
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(age L)
 0 118221.73
 1 160644.47
 2 216700.25
 3 290083.66
 4  385198.2
 5  507164.8
 6  661762.2
 7    855268
 8 1094162.8
 9 1384658.8
10   1732022
11 2139667.5
12 2608039.5
13   3133333
14 3706174.5
15   4310454
16   4922583
17   5511501
18   6039773
19   6466058
20   6466058
end
------------------ copy up to and including the previous line ------------------