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/
_____________________________________________________________________
Mensaje analizado y protegido por Telefonica Empresas
*
* 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/
Privileged, confidential or patient identifiable information may be contained in this message. This information is meant only for the use of the intended recipients. If you are not the intended recipient, or if the message has been addressed to you in error, do not read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. Instead, please notify the sender by reply e-mail, and then destroy all copies of the message and any attachments.
*
* 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/