Statalist The Stata Listserver


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

st: RE: Computing a cumulative frequency variable


From   "Alex Ogan" <[email protected]>
To   <[email protected]>
Subject   st: RE: Computing a cumulative frequency variable
Date   Thu, 11 May 2006 13:37:51 -0400

. list

     +------------+
     | id   etime |
     |------------|
  1. | 15       0 |
  2. | 15       6 |
  3. | 15       2 |
  4. | 20      10 |
  5. | 20      30 |
     |------------|
  6. | 20       4 |
     +------------+

. bysort id: gen cumfreq = sum(etime)

. list

     +----------------------+
     | id   etime   cumfreq |
     |----------------------|
  1. | 15       0         0 |
  2. | 15       6         6 |
  3. | 15       2         8 |
  4. | 20      10        10 |
  5. | 20      30        40 |
     |----------------------|
  6. | 20       4        44 |
     +----------------------+

.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Raphael
Fraser
Sent: Thursday, May 11, 2006 1:32 PM
To: [email protected]
Subject: st: Computing a cumulative frequency variable

I have the following variables and would like to generate or compute
the cumulative frequency of etime. The end result should look like
this:

id    etime  cum. freq
15     0       0
15    6        6
15    2        8
20    10      10
20    30       40
20    4         44

Raphael

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


This message is intended solely for the designated recipient(s). It may contain confidential or proprietary information and may be subject to confidentiality protections. If you are not a designated recipient, you may not review, copy, or distribute this message. If you receive this in error, please notify the sender by reply e-mail and delete this message. 

Arrowstreet Capital, L.P. is an Equal Opportunity Employer. 



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index