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

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

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... HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Kit Baum Sent: Thursday, October 16, 2008 1:58 PM To: statalist@hsphsun2.harvard.edu 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 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/ * * 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/

**References**:**st: re: weighted daily mean***From:*Kit Baum <kitbaum@mac.com>

- Prev by Date:
**st: re: weighted daily mean** - Next by Date:
**st: RE: RE: Use foreach or forvalues to create the long form data** - Previous by thread:
**st: re: weighted daily mean** - Index(es):

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