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

Re: st: RE: Collapse w. Weights


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

Mostly, I didn't know how the weights were or could be used in the median computation, but your explanation makes great sense.  Basically, if the turnovers are sorted in ascending order, the asset-weighted median turnover is the one that first hits the cumulative 50% weight level.

Many thanks,

Eric


>I don't know why you thought otherwise, but the weights are
>applied to the medians too. In 1997, for example, as a total
>weight of 200 is assigned to .5 and a total weight of 197 is
>assigned to higher values, .5 emerges as the median.
>
>Nick
>[email protected]
>
>Eric G. Wruck
> 
>> 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?



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