Kit et al.--
This is a very useful comparison, but I wonder if a solution from
first principles (avoiding -egen-) might not be in many cases faster
and more flexible. As an example of the latter property, consider
computing weighted medians (though it seems that Ben Jann's approach
can handle weights).
ps. The original query was from Erasmo Giambona; Friedrich Huebler
provided the first answer.
On Dec 21, 2007 11:02 AM, Kit Baum <[email protected]> wrote:
> To complete the discussion of Friedrich Huebler's query, I present
> here three solutions to the problem (none of which I have written).
> The first is the implementation of Nick Cox's suggestion from his FAQ
> http://www.stata.com/support/faqs/data/members.html
> Nick graciously provided a correction to my imperfect implementation
> of the FAQ's suggestions which made it work properly.
>
> The second is Friedrich's corrected code.
>
> The third is Ben Jann's. When this problem was posed I immediately
> thought of jackknife computations, as that's what a jackknife does--
> it calculates a statistic leaving one out. A bit tricker here,
> naturally, but Ben shows how his functions from -moremata- that
> calculate medians and jackknife statistics may be used for a Mata-
> based solution. That might seem unnecessarily complex, but Mata's
> speed advantage over do-file code might make an important difference
> to someone trying to do something like this on a really large data set.
*
* 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/