Plot your data
Seth Roberts, Ph.D.*
Department of Psychology, University of California, Berkeley, California, USA; and Tsinghua University, Beijing, China
Lesson 3: Plot your data
Writers of statistics textbooks tend to copy other text-
books rather than draw on experience. This leaves a serious
gap: Techniques that are highly useful in practice are not
taught. With this series of columns I am trying to fill that
gap. The first column  pointed out that doing something
(imperfect) is better than doing nothing. The second  was
about the value of transforming your data.
A third neglected lesson about data analysis is plot your
data. More precisely, make all reasonable graphs of your
data. Make a histogram of every measurement (to see its
distribution), plot every measurement against its date, and
plot every measurement against every other measurement.
This is a good way to generate ideas.
To read almost any statistics textbook, even the best
(e.g., Box et al. ), you’d think science was all about
testing ideas. It isn’t. Where do the tested ideas come from?
Idea generation, which these books ignore, is just as im-
portant as idea testing. One of the best ways to generate new
ideas worth testing, I have found, is to make many graphs of
It is like searching for buried treasure. New ideas worth
testing are very valuable but hard to find. Only a tiny
fraction (1%?) of the graphs I’ve made led to new ideas but
some of those ideas had a big effect.
My graphs generated new ideas in two ways. 1) Causal-
ity. The graph suggested a cause–effect relation I hadn’t
thought of. 2) Simplicity. Something turned out to be sim-
pler than expected. Here are examples.
Weight and sleep duration
Hoping to sleep better, I measured my sleep duration .
During a routine analysis of the data, I plotted sleep duration
versus date. The graph showed that my sleep duration had
sharply decreased several months earlier, which I hadn’t
noticed. The sleep change occurred at exactly at the same
time I’d lost weight by changing my diet. The dietary
change was to eat less-processed food, food closer to its
natural state—to eat oranges instead of orange juice, for
example. The upper panel of Figure 1 shows the decrease in
sleep duration; the lower panel of Figure 1 shows the weight
loss. Before seeing these data, I’d never suspected that
weight controls sleep duration, nor had anyone else, as far
as I know. I later found other evidence for this . In a
circuitous way, the graph of sleep duration led to several
more new ideas; the first was that breakfast caused early
Reward expectancy and bar-press duration
Learning research is often done with rats in Skinner boxes,
experimental chambers with a bar that a rat can press and a
pellet dispenser. The rats press the bar to get food pellets.
Figure 2 shows Skinner-box results from rats trained with a
the box was dark and quiet. Now and then a light or white
noise went on. This marked the start of a trial. On most trials,
the rat’s first bar press more than 40 s later was rewarded, and
the signal went off. Earlier bar presses had no effect. For
example, suppose a rat presses the bar 5, 22, 28, 36, and 37 s
after the start of the trial. Nothing happens. Then it presses the
bar 42 s after the start of trial. This bar press causes the pellet
dispenser to dispense a food pellet and turns off the light,
ending the trial. On other trials, however, the signal lasted
much longer than 40 s and no food was given. The upper panel
of Figure 2 shows bar-pressing rate as a function of time since
the start of the signal. Bar-pressing rate varied with time; it
reached a maximum around the time that reward was most
likely. These results were what I expected. In contrast, I was
shocked by a parallel graph that showed bar-press duration
(how long the rats held the bar down) as a function of time
since the start of the signal (lower panel of Fig. 2). The first
time I saw it I thought I’d made a mistake because it looked so
different from the rate function. Eventually its shape made
* Corresponding author. Tel.: ?510-418-7753; fax: ?267-222-4105.
E-mail address: email@example.com (S. Roberts).
Nutrition xx (2009) xxx
0899-9007/09/$ – see front matter © 2009 Elsevier Inc. All rights reserved.
ARTICLE IN PRESS