Statalist


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

Re: st: simple question (freq)


From   Matt Spittal <Matt.Spittal@cancervic.org.au>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: simple question (freq)
Date   Thu, 16 Apr 2009 10:47:14 +1000

Sebastián,

The equivalent function in Stata is -sum-, i.e. -generate var =
sum(variable)-.

To given an example from the auto dataset

    sysuse auto, clear
    generate sum_weight = sum(weight)

-- Matt
matt.spittal@cancervic.org.au






On 16/4/09 7:17 AM, "Sebastián Daza" <sebastian.daza@gmail.com> wrote:

> Hi everyone,
> 
> Does somebody know how to create a new variable with the accumulated
> frequency of a variable? It's very simple in SPSS:
> 
> create var=csum(variable).
> 
> Until now I haven't been able to do it with STATA
> 
> Regards


*
*   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   |   What's new   |   Site index