Plotting data

Plotting your data

This page has been made largely redundant by the plotting options in JASP and JAMOVI - my statistical packages of choice. But if you do want to use SPSS for your stats, you shouldn't feel tethered to the (very poor) options that package provides for plotting your data.

Controversially, I like to plot my data in Excel. I like to do things this way for several reasons. First, data plotted in an Excel sheet can easily be viewed and edited by anyone, from the crustiest old scientist to the greenest undergraduate student (remember programming whizkids - the vast majority of STEM scientists can do very little programming - if you aren't trained early in your career, you'll likely never get the hang of it). Second, number crunching in Excel is very easy and visual - good luck trying to wade through someone's R code if you want to make sure they haven't made a mistake. Finally, I think having all your data laid out in Excel is a good way to have an automatic double check for outliers and data entry errors. Another less-known feature of Excel is that you can File-->Export the figure in vector format (.pdf or .xps), which will save you having to worry about the quality/DPI issues when submitting figures to journals. You'll typically need to trim the excess white space off of these files, which can be easily accomplished using a small program called Briss.

In terms of what sort of thing I like to plot, here's an example of a typical bar graph from one of my papers.

As you can see, it's pretty simple stuff, plotting the mean of a row of data [=AVERAGE(AI2:AI36)], with the standard error of the mean [=STDEV(AI2:AI36)/SQRT(COUNT(AI2:AI36)], then manually creating error bars with this SEM value. A bit laborious, but I'm happy enough with how these figures look.

Recently, however, there's been a bit of a buzz about whether bar graphs are appropriate, or whether they really just serve to obscure the data. This post by Guillaume Rousselet of Glasgow University highlights the issues nicely, and suggests some alternative ways to plot your data, ensuring that all your datapoints can be seen. So, can we create plots showing the mean value alongside all the individual data in Excel? With a bit of tinkering, yes we can!

First, lay out your data like so, with each column representing a condition and each row representing a participant. Reserve the row immediately below your condition names for the average score of each condition. Next highlight all that you wish to plot, including the averages and condition names, and insert a chart. From the 'All Charts' tab, choose Combo, and change Condition 2 (of whichever the final condition in your sheet happens to be) to Scatter.

This will give you an absurd looking figure. Fix it by clicking on 'Switch Row/Column'

Which will give you something much better looking

Now all that's left to do is to pretty things up a bit and voila - you have a bar chart which shows your mean, as well as each individual's datapoint - nothing is obfuscated but the graph is still nice and clean.

Here, you can download the spreadsheet I used to create these images (populated with random data), as well as various chart templates which should save a few of these steps, and a few for line/dot versions which work well for within-subject designs. 

If you want some even fancier options, check out this page of resources

Happy plotting!