Statalist The Stata Listserver


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

Re: st: Title: How to calculate average in different interval


From   "Neil Shephard" <nshephard@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Title: How to calculate average in different interval
Date   Thu, 8 Jun 2006 12:41:59 +0800

On 6/8/06, Gary Tian <G.Tian@uws.edu.au> wrote:
Title:  How to calculate average in different interval ?

---------------------------------------------

Can anyone help me ?
bysort date time: gen volavg = cond(_N == _n, sum(vol) / _N , .)

should do the trick.

HTH's

Neil
--
"After one look at this planet any visitor from outer space would say
"I want to see the manager."" - William S. Burroughs

()  ascii ribbon campaign - against html mail
/\                        - against microsoft attachments
(www.gnu.org/philosophy/no-word-attachments.html)

Email - nshephard@gmail.com / neilshep@cyllene.uwa.edu.au
Website - http://slack.ser.man.ac.uk/
*
*   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