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   Pedro Nakashima <nakashimapedrolist@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Accumulated mean and standard deviation
Date   Sun, 8 Jan 2012 17:04:30 -0200

Perfect!

Thank you Matthew and Sunil!

Best,
Pedro.

2012/1/8 Sunil Kumar <stuff.sunil@googlemail.com>:
> Does this achieve what you want?
>
> gen mean=.
> gen sd=.
>
> local k=_N
> forv i=1/`k' {
> qui su x in  1/`i'
> qui replace mean=r(mean) in `i'
> qui replace sd=r(sd) in `i'
> }
>
> Best,
> Sunil
> *
> *   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/

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