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" <[email protected]>
To   [email protected]
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 <[email protected]> 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 - [email protected] / [email protected]
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index