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

st: RE: Collapse w. Weights


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Collapse w. Weights
Date   Sun, 6 Nov 2005 23:35:37 -0000

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 
n.j.cox@durham.ac.uk 

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