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

st: RE: re: weighted daily mean

From   "Martin Weiss" <>
To   <>
Subject   st: RE: re: weighted daily mean
Date   Thu, 16 Oct 2008 14:01:31 +0200

Well, sure, but from the initial request "...I want to calculate the total
mean..." I did not pick up that she wanted what you are proposing...


-----Original Message-----
[] On Behalf Of Kit Baum
Sent: Thursday, October 16, 2008 1:58 PM
Subject: st: re: weighted daily mean

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  

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
An Introduction to Modern Econometrics Using Stata:

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2023 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index