Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Collapse w. Weights


From   "Eric G. Wruck" <[email protected]>
To   [email protected]
Subject   st: Collapse w. Weights
Date   Sun, 6 Nov 2005 18:18:02 -0500

I have mutual fund data on turnover & total net assets. Below you'll see an example:


+-----------------------+
| year turnover tna |
|-----------------------|
1. | 1997 .5 200 |
2. | 1997 .73 172 |
3. | 1997 1.1 25 |
4. | 1998 .61 255 |
5. | 1998 .96 220 |
|-----------------------|
6. | 1998 .85 75 |
+-----------------------+


I want to get an asset-weighted average turnover ratio as well as report median turnover.

I issue the command:

. collapse (mean) avgturn=turnover (median) medturn=turnover [aweight=tna], by(year)

& obtain

+---------------------------+
| year avgturn medturn |
|---------------------------|
1. | 1997 .6374307 .5 |
2. | 1998 .7827273 .85 |
+---------------------------+

The average turnover ratios are precisely what I want, but I don't understand what Stata is doing with the medians. I thought the weights wouldn't enter into the calculations & that I would obtain medians of 0.73 & 0.85 for 1997 & 1998. However, for 1997 I get a median turnover of 0.5. Would somebody kindly explain this to me?

Many thanks,

Eric



--

===================================================

Eric G. Wruck
Econalytics
2535 Sherwood Road
Columbus, OH 43209

ph: 614.231.5034
cell: 614.330.8846
eFax: 614.573.6639
eMail: [email protected]
website: http://www.econalytics.com

====================================================
*
* 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