What is the minimum "recommended" sample size to generate boxplots?

If I'm comparing different methods and each method has a different sample size, is it fine to use boxplots for this comparison? If not, what is the best way to compare methods with different sample sizes?


1 Answer 1


[I thought I had written an answer to the first question but I can't locate one.]

With 5 or fewer observations, you might as well just plot the actual points. Or indeed with somewhat larger numbers than 5. (If you need the boxplot anyway, it can't hurt to show the values as well.)

It doesn't matter when comparing across samples that the samples aren't the same size, but if you have much larger samples in some groups you should see more points outside the ends of the whiskers on those.

what is the best way to compare between methods with different sample size

You might compare quantile plots, perhaps, or (as Nick Cox has suggested on at least one of his answers, but which I also can't locate right now -- edit: see here) you might combine such a plot with a boxplot by plotting the quantile plot under the boxplot.

Nick shows an example of a quantile plot here

  • 2
    $\begingroup$ Other examples at stats.stackexchange.com/questions/114744/… stats.stackexchange.com/questions/181501/… $\endgroup$
    – Nick Cox
    Commented Feb 10, 2016 at 9:17
  • 1
    $\begingroup$ This issue usually comes up only when generating side-by-side boxplots and one or more of the groups is small. In such cases, for visual comparison, it may be advisable to draw boxplots even for groups of one! Also, have you considered including a visual representation of the group size, such as (a) making box widths proportional to the size or (b) including a notch or other device to indicate the standard error of the median? $\endgroup$
    – whuber
    Commented Feb 10, 2016 at 14:25
  • 1
    $\begingroup$ nature.com/articles/nmeth.2813.pdf?origin=ppub suggests to make the box width proportional to the square root of the sample size. Of course, this won't be useful for extreme size differences. $\endgroup$ Commented Jul 5, 2022 at 12:55
  • $\begingroup$ Sure, that's definitely a thing -- that suggestion has been around a very long time (I first saw it in the early to mid 80s but it comes from a paper Tukey was an author on in the 70s). Many packages can do this. I don't think this does a lot to help detect differences (per the question), though the notched boxplot (from the same article) does help with spotting location-shifts as long as we're not too fussy about what we mean by location and don't mind not-very-accurate significance levels. I have had some value from those, but relatively less from the variable-width one. $\endgroup$
    – Glen_b
    Commented Jul 5, 2022 at 22:35
  • $\begingroup$ This paper: McGill, R., Tukey, J.W. and Larsen, W.A. (1978), "Variations of Box Plots." American Statistician, 32, 12-16. ... (edit ... oh, I see your linked article does reference that paper but omits titles; that makes it harder to spot.) $\endgroup$
    – Glen_b
    Commented Jul 5, 2022 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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