From m.crawley at imperial.ac.uk  Sun Jul 12 10:30:09 2009
From: m.crawley at imperial.ac.uk (m.crawley at imperial.ac.uk)
Date: Sun, 12 Jul 2009 10:30:09 +0200 (CEST)
Subject: [Rd] box and whisker (PR#13821)
Message-ID: <20090712083009.34D6A282EF4F@mail.pubhealth.ku.dk>

In a Box and Whisker plot, I thought that when there are outliers both abov=
e and below the whiskers, then the whiskers should both be the same length =
(plus or minus 1.5 times the inter-quartile range).

If you look at the plot for SilwoodWeather on p.155 of The R Book you will =
see that for November (month =3D 11) the upper whisker is shorter than the =
lower, while for other months with outliers both above and below, the lines=
 are the same lengths.

When there are no outliers, then of course the maximum and minimum values r=
esult in whiskers of different lengths above and below.

Here is the code that creates the problem:

data<-read.table("c:\\temp\\SilwoodWeather.txt",header=3DT)
attach(data)
names(data)

[1] "upper" "lower" "rain"  "month" "yr"

month<-factor(month)
plot(month,upper)

and exactly the same with

boxplot(upper~month)



Best wishes,

Mick

Prof  M.J. Crawley  FRS

Imperial College London
Silwood Park
Ascot
Berks
SL5 7PY
UK

Phone (0) 207 5942 216
Fax     (0) 207 5942 339


	[[alternative HTML version deleted]]



[Rd] box and whisker (PR#13821)
m.crawley at imperial.ac.uk