Statalist The Stata Listserver


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

st: RE: Computing a cumulative frequency variable


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Computing a cumulative frequency variable
Date   Fri, 12 May 2006 11:06:39 +0100

Three people suggested variations on -sum()-, 
which is naturally correct. 

This is to add that the -cumul- command 
can do this, as it can also take weights
and be used with -by:-. 

What's more, 

. search cumulative 

points directly towards -cumul-. 

Nick 
n.j.cox@durham.ac.uk 

Raphael Fraser
 
> 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

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