Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: aggregate by high frequency data


From   tashi lama <ltashi32@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: aggregate by high frequency data
Date   Wed, 27 Jun 2012 15:39:12 +0000

Hello all, 

    My dataset looks follows

 

                read_date   hits |
      |---------------------------|
   1. | 04jan2011 01:01:41      1 |
   2. | 04jan2011 01:03:07      1 |
   3. | 04jan2011 01:04:06      1 |
   4. | 04jan2011 01:08:21      1 |
   5. | 04jan2011 01:09:28      1 |
      |---------------------------|
   6. | 04jan2011 01:10:26      1 |
   7. | 04jan2011 01:27:03      1 |
   8. | 04jan2011 01:44:22      1 |
   9. | 04jan2011 01:45:56      1 |
  10. | 04jan2011 01:51:23      1 |
      |---------------------------|
  11. | 04jan2011 01:51:39      1 |
  12. | 04jan2011 01:51:58      1 |
  13. | 04jan2011 01:52:59      1 |
  14. | 04jan2011 01:53:41      1 |
  15. | 04jan2011 01:58:12      1 |
      |---------------------------|
  16. | 04jan2011 01:58:34      1 |
  17. | 04jan2011 02:05:04      1 |
  18. | 04jan2011 02:16:45      1 |
  19. | 04jan2011 02:18:06      1 |
  20. | 04jan2011 02:22:34      1 |
      |---------------------------|
  21. | 04jan2011 02:26:49      1 |
  22. | 04jan2011 02:27:05      1 |
  23. | 04jan2011 02:27:43      1 |
  24. | 04jan2011 02:31:15      1 |
  25. | 04jan2011 02:33:20      1 |


If I want to aggregate hits per day, then I would do sth like 

 

gen daily=dofc(read_date)

collapse (sum) hits, by(daily)

 

Does anyone have any idea aggregating per min or per hr or per sec for that matter? There doesn't seem to have a date-related command to do that both in manual and help? 

 

Tashi 		 	   		  
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index