[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: Adding cumulatively

From   "Nick Cox" <>
To   <>
Subject   RE: st: RE: Adding cumulatively
Date   Thu, 15 May 2008 18:08:28 +0100

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. 


Rijo John

Thanks. For some reason I though sum function will produce the same
total sum against all values.

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index