[R] Plotting league tables/ caterpillar plots

Chris Evans chris at psyctc.org
Mon Jul 24 17:39:35 CEST 2006


Eik Vettorazzi sent the following  at 24/07/2006 13:04:
> Dear list,
> I was wondering if there is a function to plot league tables, sometimes  
> also known as "caterpillar plots"?
> A league table is conceptually very similar to a box plot. One difference  
> is that the inter-quartile ranges are not shown. If there isn't such a  
> function a first attempt for a "selfmade" plot would be to tell boxplot  
> not to plot boxes (sounds silly isn't it?). I've tried the option  
> "boxwex=0" but the result is unsatisfactory.
> 
> An example for a league table can be found in Marshall, Spiegelhalter  
> [1998], Reliability of league tables of in vitro fertilisation clinics,  
> BMJ1998;316:1701-1705, you may find it at http://bmj.bmjjournals.com


Interesting, never heard the term "caterpillar plot" but I like that.  I
also call related things "biplane plots": the body is the parameter and
the wings (not really biplanes at all are they) are the 95% CI for the
parameter.  However, these caterpillar plots are rather like forest
plots or "trees plots" (I argue that you can see both the wood and the
trees!)

I tend to plot them rotated by 90 degrees and without such good
labelling as in the Spiegelhalter paper, but this code may help you.
The "traffic lights" in this superimpose overall quartiles which is used
in some colleagues' way of looking at league tables.  I've used similar
plots for proportions, means, correlations and even alpha reliability
parameters, it's fairly easy to substitute different parameters and
their CIs.  I prefer to use a more exact estimator of the CI of the
median than the one that, if I remember rightly, is the default in the
boxplot which is, I think a much quicker but less robust estimator of
the CI for each sample.

I'd appreciate gentle constructive criticism of my coding, I know I'm a
much better psychotherapist than a programmer!

C

-- 
Chris Evans <chris at psyctc.org>
Professor of Psychotherapy, Nottingham University;
Consultant Psychiatrist in Psychotherapy, Rampton Hospital;
Research Programmes Director, Nottinghamshire NHS Trust;
Hon. SL Institute of Psychiatry, Hon. Con., Tavistock & Portman Trust
**If I am writing from one of those roles, it will be clear. Otherwise**

**my views are my own and not representative of those institutions    **
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Weimar-plot-median.R
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060724/932dfecc/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: conf.median.R
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060724/932dfecc/attachment-0001.pl 


More information about the R-help mailing list