Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: adding variables within time range


From   "Coleman, Greg" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: adding variables within time range
Date   Sun, 24 Nov 2013 19:12:53 +0000

Hi Stata users - so new at Stata I am not sure how to word this. I have data with the time variable in military format. There is also another variable in the row which is an integer just representing length of time,  in minutes. A small snip is as follows:

Time      Length
236         24
145         300
218         10
2334       31

What I want to do is add length, for all times occurring between 1 and 3am, 3-5am, and so on.
In this example 1-3am would be = 24+300+10.

Do I have to create a new variable for each time slice I choose? If so, how would I do the addition?
Thank you!
Greg




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index