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]

Re: st: Accumulated mean and standard deviation


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: Accumulated mean and standard deviation
Date   Sun, 8 Jan 2012 21:02:20 -0500

Pedro Nakashima <[email protected]>:
Faster in one line for each.
by day: gen mean=sum(x)/_n
by day: gen sd=sqrt((sum(x^2)-mean^2*_n)/(_n-1))

On Sun, Jan 8, 2012 at 5:34 PM, Pedro Nakashima
<[email protected]> wrote:
> Thank you Matthew, It worked perfectly!
>
> Best,
> Pedro.
>
>
>
> 2012/1/8 Matthew White <[email protected]>:
>> Hi Pedro,
<snip>
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index