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/