13
$\begingroup$

I have a small data set of 14 separate times to complete a task. However I am having difficulty finding an appropriate graph to use to graph the data. If the sample was larger I would use a box plot or histogram but I'm not sure if it would be appropriate to use in this case when the sample is so small.

Update: The times are 5.2,3.9,5.6,4.2,3.8,4.1,6.0,5.6,4.4,4.5,4.9,4.5,4.9,4.2

$\endgroup$
1
  • 4
    $\begingroup$ Nothing beats showing the real data that you care about as a concrete example to encourage people to post different solutions. In advance I suggest dot or stripplots and quantile plots with box overlaid. $\endgroup$
    – Nick Cox
    Feb 17, 2016 at 17:10

4 Answers 4

16
$\begingroup$

I think the cardinal principle here is that you can and should show all the individual values. Even if the detail is not obviously interesting or useful, there is no reason not to show it, or to oblige the reader to decode (say) a histogram in which the bars might represent just one or two values.

I offer here a small composite. Top left is a dot or strip plot (at least twenty other names have been used for the same idea) presented horizontally and top right the same idea presented vertically. Instances of the same value are matched by stacking.

At bottom is a quantile-box plot, in Parzen's sense, in which the tacit horizontal scale is cumulative probability (plotting position, in a common jargon) and the conventional median-and-quartiles box can be drawn such that (in principle) half the values are inside the box, as always advertised, and half the values outside. The extra horizontal line here represents the mean. Some people add means to box plots as an extra point or marker symbol; I find that can clash with showing the data themselves, and I prefer an extra line. If the line for the median and the line for the mean appeared to coincide, you would need to think what to do. Almost always the mean and median are discernibly different.

Arguably it is standard to make the units of measurement explicit on the graph, but I don't see what they are.

enter image description here

(I deliberately pushed an extra point here, which is that graphs can be very small but still informative. In practice, I wouldn't make them quite this small.)

EDIT:

Cross-references added to quantile-box plots broadly in Parzen's sense (further references in second below; other uses of "quantile-box plots" exist)

How can I measure difference between non-parametric data with many zeros?

How to use boxplots to find the point where values are more likely to come from different conditions?

How to visualize independent two sample t-test?

How do I get which experiment is doing better using the Mann-Whitney U Test?

Shera, D.M. 1991. Some uses of quantile plots to enhance data presentation. Computing Science and Statistics 23: 50-53.

Militký, J. and M. Meloun. 1993. Some graphical aids for univariate exploratory data analysis. Analytica Chimica Acta 277: 215-221.

Meloun, M. and J. Militký. 1994. Computer-assisted data treatment in analytical chemometrics. I. Exploratory analysis of univariate data. Chemical Papers 48: 151-157.

EDIT 2:

The main point of these threads is not just to answer the immediate question, but to touch on closely similar questions that might interest others.

Some other graph designs in other answers here show identifiers, agnostically labelled 1 ... 14 in the absence of other detail. Supposing that these and other identifiers were of use in interpretation, a simple design to show them is a (Cleveland) dot chart. Here are two among several possibilities, in which identifier order is respected literally (left) and in which the values are sorted (right). There is plenty of room for longer labels if needed.

An advantage of this design over bar charts is that the response or outcome axis may start at a value not zero if that seems a better choice.

Rotating the charts so that the response axis is vertical may be imagined easily too.

enter image description here

$\endgroup$
3
  • $\begingroup$ (+1) I have sometimes seen the dot or strip plot, particularly if vertically oriented, with the "stacked" points centrally aligned rather than left-aligned (ie if there were three stacked points then the middle one would be in line with the unstacked points). This gives a line of symmetry which is aesthetically pleasing but I'm not sure how beneficial it is practically. Perhaps it makes it easier to superimpose a box. Does this have a separate name, do you know? And has there been any advice to avoid/adopt it? $\endgroup$
    – Silverfish
    Feb 17, 2016 at 20:25
  • 1
    $\begingroup$ Also, is there any chance you could give a reference for Parzen? I have always liked these plots but have never actually read a proper reference for them. $\endgroup$
    – Silverfish
    Feb 17, 2016 at 20:27
  • $\begingroup$ @Silverfish Centred (centered) variants are certainly popular and often discussed. The small issues seem to be a desire for symmetry, as you mention, versus a design to resemble histogram style, which I tend to prefer slightly, but it's a matter of taste and circumstance. I've added cross-references and in turn would welcome others. $\endgroup$
    – Nick Cox
    Feb 17, 2016 at 20:45
3
$\begingroup$

@Nick Cox has already given some good examples, two other options I use somewhat frequently are the box plot with points overlayed, or jittered slightly,

enter image description here

enter image description here

With R Code

times<-c(5.2,3.9,5.6,4.2,3.8,4.1,6.0,5.6,4.4,4.5,4.9,4.5,4.9,4.2)
boxplot(times)
points(rep(1,length(times)),times,cex = 3, pch = 'x')

boxplot(times)
points(jitter(rep(1,length(times)),amount = 0.1),times,cex = 3, pch = 'x')

EDIT: You could also use a violin plot if you so desired

ggplot(data.frame(times), aes(x = rep(0,length(times)), y = times)) + geom_violin() + geom_jitter()

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Thanks very much for the reply. I was reluctant to use box plots in my analyses originally due to the size of the sample. But after looking at different text books it seems my sample size is sufficient. $\endgroup$
    – Eamonn
    Feb 17, 2016 at 21:19
1
$\begingroup$

Your question reminded me of the technique described in this blog post. Its about the visualization of discrete events.

The core trick is to plot the time before an event x the time after an event.

Your data visualized[1]

This might be by chance, but to top middle area contains no data. So there is some structure visible.


The quick and dirty R code.

data <- c(5.2,3.9,5.6,4.2,3.8,4.1,6.0,5.6,4.4,4.5,4.9,4.5,4.9,4.2)
x=data[1:12]
y=data[2:13]
plot(x,y, col="white", xlab="Time before an event", ylab="Time after an event"  )
for (i in 1:12) {
    text(x[i],y[i], i)
}
$\endgroup$
4
  • $\begingroup$ OP said 14 separate times. I read that as implying that these are not a series. If they are a series, your idea is certainly pertinent. $\endgroup$
    – Nick Cox
    Feb 17, 2016 at 18:22
  • $\begingroup$ You are probably right. However, even if they are not a series, the graph would show dependencies between times. Obviously the axis labels are wrong then. $\endgroup$ Feb 17, 2016 at 18:29
  • 2
    $\begingroup$ Only the OP can clarify exactly what the data are, but I don't think this graph wins either way. If the data are separate times, then the graph is meaningless unless there is a meaning to the order in which values are given. $\endgroup$
    – Nick Cox
    Feb 17, 2016 at 18:35
  • $\begingroup$ fyi text takes vector arguments - text(x, y, 1:12) should work. $\endgroup$ Feb 18, 2016 at 14:18
1
$\begingroup$

Another idea, since you're using time.

A racetrack plot - a barplot with polar coordinates - gives the same effect like a stopwatch:

racetrack

Ideally the observation labels would be superimposed on the bars or at least on the other end. Right now the viewer has the extra strain of keeping track of which observation is which (up/down) when making any comparisons.

$\endgroup$
2
  • 2
    $\begingroup$ I have to regard that as an eccentric, indeed to be candid an utterly perverse, graph technique. The eye sees not even length of arc, but an area to be decoded as such, but the brain has to intervene and underline that only the rotation angle is informative. It's hard work even to see exactly which values are less than, equal to, or greater than one another, which is immediate in any acceptable graph style. $\endgroup$
    – Nick Cox
    Feb 18, 2016 at 9:43
  • $\begingroup$ The only plus I can see for this design, unless the grading is for unusual design, is that the identifiers #1 to #14 are immediate in this design. I've picked up this point in an edit to my own answer. $\endgroup$
    – Nick Cox
    Feb 18, 2016 at 9:59

Your Answer

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

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