17
$\begingroup$

I could use some guidance about presenting some data.

This first plot is a case-control comparison for the cytokine IL-10. I've manually set the y axis to include 99% of the data.

IL-10 With Manual Y axis

The reason I set this manually is because the case group has an extreme outlier. With outlier

My collaborators are hesitant to perform an outlier removal to our dataset. I'm OK with it, but they'd rather not. That'd be the obvious solution. But if I'm going to keep all the data and not remove this outlier, how can I present this boxplot optimally? Split axis? Is it acceptable to use just the first graph and note that it was constructed to include all the data? (This option feels dishonest to me). Any advice would be great.

$\endgroup$
  • 5
    $\begingroup$ Why not present both plots? $\endgroup$ – Alexis Sep 8 '14 at 20:52
23
$\begingroup$

I'd say that with data like these you really need to show results on a transformed scale. That is the first imperative and a more important issue than precisely how to draw a box plot.

But I echo Frank Harrell in urging something more informative than a minimal box plot, even with some extreme points identified. You have enough space to show much more information. Here is one of many examples, a hybrid box and quantile plot. As in your data, there are two groups being compared.

enter image description here

I will take these two points one by one and say more.

Transformed scale

In the simplest case, all your values may be positive and you should then first try using a logarithmic scale.

If you have exact zeros, a square root or cube root scale will still improve the extreme skewness. Some people are happy with log(value + constant), where constant is most commonly 1, as a way of coping with zeros.

The implications for box plots of using a transformed scale are subtle.

If you use the common Tukey convention of showing individually all points beyond upper quartile + 1.5 IQR or lower quartile - 1.5 IQR, then arguably those limits should be calculated on the transformed scale. That is not the same as calculating those limits on the original scale, then transforming.

Instead I'd support what appears to be still a minority convention of selecting quantiles for the ends of whiskers. One of several advantages of that is that transform of quantile = quantile of transform, at least closely enough for graphical purposes in most cases. (The small print is whenever quantiles are calculated by linear interpolation between adjacent order statistics.)

This quantile convention was suggested fairly prominently by Cleveland (1985). For the record, enhanced box plots with boxes to quartiles, thinner boxes to outer octiles (12.5 and 87.5% points) and strip plots of data were used in geography and climatology by (e.g.) Matthews (1936) and Grove (1956), under the name "dispersion diagrams".

More than box plots

Box plots were re-invented by Tukey around 1970 and most visibly promoted in his 1977 book. Much of his purpose was to promote graphs that could be quickly drawn using pen(cil) and paper in informal exploration. He was also suggesting ways of identifying possible outliers. That was fine, but now we all have access to computers it's no pain to draw graphs showing, if not all the data, then at least much more detail. The summary role of box plots is valuable, but a graph can show the fine structure too, just in case it is interesting or important. (And what researchers think is uninteresting or unimportant might be more striking to their readers.)

There is plenty of room for polite disagreement about exactly what works best, but bare box plots have been rather oversold, in my view.

Stata users can find more on the program that drew the figure in this Statalist post. Users of other software should find no difficulty in drawing something as good or better (else why use that software?).

Cleveland, W.S. 1985. Elements of graphing data. Monterey, CA: Wadsworth.

Grove, A.T. 1956. Soil erosion in Nigeria. In Steel, R.W. and Fisher, C.A. (Eds) Geographical essays on British tropical lands. London: George Philip, 79-111.

Matthews, H.A. 1936. A new view of some familiar Indian rainfalls. Scottish Geographical Magazine 52: 84-97.

Tukey, J.W. 1977. Exploratory data analysis. Reading, MA: Addison-Wesley.

$\endgroup$
  • 1
    $\begingroup$ I have never seen such juxtaposition of box plots and ECDFs before. Really cool! What do you think about overlaying the two ECDFs in a separate panel? $\endgroup$ – Frank Harrell Sep 9 '14 at 1:57
  • 2
    $\begingroup$ @Frank Harrell Thanks. Overlaying is a good idea too. See e.g. stata-journal.com/sjpdf.html?articlenum=gr0018 for some examples in my work. $\endgroup$ – Nick Cox Sep 9 '14 at 7:40
13
$\begingroup$

Not to take anything away from Nick's excellent answer, which I think is well worth a tick and an upvote - but I wanted to explore some possibilities.

With such heavily skew data across several orders of magnitude, plotting on a log-scale is often quite revealing; note that you can still have tick marks and tick mark labels in original values. (I agree with Nick's points relating to transformations, so I won't expand further on that.)

Another option besides transformation is to do something like your second plot, but include an indication of all values not plotted:

$\ $ enter image description here

That way you're not removing outliers, just displaying them differently.

However, I'd join Frank and Nick in suggesting using a more informative display than a plain boxplot - the combination of a boxplot with quantile plot in Nick's post seems a particularly good notion, though one might plot the quantile plot lightly over (or under, as here) the corresponding box instead of beside it:

$\ $ enter image description here

If you're not doing something like that (just going with a plain boxplot, say), I'd suggest substantially narrower boxes.

$\endgroup$
  • 3
    $\begingroup$ Superimposing quantile and box plots is attractive too. It underlines that the box plot is a reduction of the quantile plot, although to some the box plot might then seem redundant. For strong emphasis on the relationship between the two graphs, see e.g. Parzen, E. 1979. Nonparametric statistical data modeling. Journal of the American Statistical Association 74: 105-121 $\endgroup$ – Nick Cox Sep 9 '14 at 7:49
  • $\begingroup$ Do you have the OP's dataset? Or are you scraping the graph/faking it? $\endgroup$ – Nick Cox Sep 9 '14 at 7:50
  • 2
    $\begingroup$ @Nick Just faking it, basically; I effectively scraped the extreme points (just by hand, there were so few), and then generated values below the upper quartiles by sampling from 3 uniforms between the known values (the 3 quartiles and the minimum), and between upper quartiles and the end of the upper whiskers with exponentials, then added the extreme points in (just so my boxplots would look similar). At least that's the gist of the idea. The extreme points won't be accurate, so the printed values on my plot are more like examples. $\endgroup$ – Glen_b Sep 9 '14 at 9:56
  • $\begingroup$ @Glen_b I can ask a separate question if you prefer, but what method did you use to overlay the quantile plot with the boxplot? $\endgroup$ – Tavrock Mar 13 '17 at 1:35
  • $\begingroup$ @Tavrock It's two and a half years since I wrote that, so I'm guessing. The obvious thing to do is call points to display the quantile values (it looks like something along the lines of xs=sort(x); points(ppoints(xs),xs) after the boxplot, but on close examination the points are below the boxplot, so it may have been plot then boxplot with add=TRUE or it may have been boxplot, then points then boxplot over the top... maybe $\endgroup$ – Glen_b Mar 13 '17 at 1:43
4
$\begingroup$

I prefer extended box plot or violin plots because they contain so much more information. I scale extended box plots to the 0.01 and 0.99 quantiles of the combined samples. See http://biostat.mc.vanderbilt.edu/wiki/pub/Main/StatGraphCourse/graphscourse.pdf for details.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.