Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Cummulative sum & dealing with time


From   Richard Goldstein <richgold@ix.netcom.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Cummulative sum & dealing with time
Date   Thu, 05 May 2005 09:18:35 -0400

for your first question, sound like you want the -sum- function (NOT the egen version); see -functions- in the manual or the help

Rich

kelly johnson wrote:


hi,

how do i genrate a cummulative sum for a variable. eg. my data looks like this

date time Var1

i want to create a new variable that is a running sum of Var1 (eg. the first obs is the same, the second obs= the first obs + the second obs, etc.).

also, what is the best way to deal with time? i have a date in the mm/dd/yy formate and the minites of the date in hh:mm format. what is the best way to format and use my time variable.

thanks,

kelly
*
*   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/



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