Not surprising, until one reads the help. Having it that way round means
that the totals are one step away.
bysort id (year) : gen cumvar1 = sum(var1)
by id: gen sumvar1 = cumvar1[_N]
If I had been present at the creation, I would have made a case for a
name like -cusum()-. But I turned up too late and a few thousand miles
(km) away.
Nick
Rijo John
Thanks. For some reason I though sum function will produce the same
total sum against all values.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/