Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: re: weighted daily mean


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: re: weighted daily mean
Date   Thu, 16 Oct 2008 07:57:33 -0400

<>
Martin said

Would not - egen trademeantot=mean(trade)- be a shortcut to the desired
result, i.e. why go through the daily mean to arrive at the overall mean?


No. If the point is that each day there is a mean value, you now have a daily timeseries, and you want the mean of that series. If the underlying microdata encompass widely differing numbers of trades per day (as Nick has suggested), then the 'overall mean' can only be calculated from the microdata by using appropriate weights. The mean of daily means assigns equal weights to each day, which implies that a weight of 1/(N_t) is being applied to each trade, where N_t is the number of trades on day t. If you calculated the right weight vector, the weighted mean of individual trades would equal the 'overall mean' calculated from equally-weighted daily observations, but not otherwise.

Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index