Graphical Presentation of Data

· Q 1. I am keen to familiarise myself with some of the graphical capabilities of Excel. Can you recommend a good resource?

A. There are a number of useful guides and associated guidance provided under  Excel – handy guides, tutorials and tips.

here

· Q 2. I have entered my questionnaire data into a spreadsheet as individual scores ranging from 1 to 5 but if I am to represent my results in a barchart, it would be good for the reader to see what these scores stand for (i.e. “Strongly Approve”, “Not strongly approve”, “Not strongly disapprove”, etc.). How does SPSS cope with this problem?

A. You need to define value labels in the Variable View window.  For instructions on how to do this and to familiarize yourself more generally with the functionality within the SPSS Variable View window, please consult the Variable View tutorial recommended in the solution to Q.7 under the FAQ section Arranging Data in Spreadsheets for Statistical Analysis.

· Q 3. Can you recommend any resources that will provide me with a kick-start for creating graphs in SPSS?

A. Yes, certainly. While the SPSS graphs interface is markedly different from that for Excel, it is also easy to use once you know how and has a great deal more to offer in terms of the range of graphs which can be produced. Here is handy guide:

Using SPSS 20, Handout 3: Producing Graphs. 

Please note that if you are specifically interested in adding 95% confidence intervals (CIs) to frequency barcharts in SPSS, section 1 of the above guide will show how easy it is to create the relevant chart in SPSS. (Please note that the button Element Properties will allow you to edit the default setting for error bars so that standard errors are replaced by 95% confidence intervals in a single step. This is less cumbersome than the procedure required in Excel, involving calculation of each CI separately followed by manual inclusion of the lower and upper CI limit for each bar in a dialogue box! 

Also, if you have not already done so, you would be well advised to consult the first two introductory resources under GETTING TO KNOW SPSS .

If, having considered the above resources, you would like to focus on creating a particular type of chart, you can can try searching within the StatsforMedics WordPress site to see  if it is already listed .

· Q 4. I am interested in exploring the distribution of my data and have heard that a stem-and-leaf plot may be useful. How can I learn more?

A. A stem-and-leaf plot is very much like a crude histogram on its side. You can find out about how to create this kind of plot in SPSS and indeed about other ways of exploring your data in SPSS by referring to the resource SPSS INSTRUCTION – CHAPTER 3 together with the solutions to the many other questions offered on the current WordPress page.

· Q 5. I have prepared some data relating to Executive Dysfunction measures for school children and would like to use some appropriate graphical procedures for exploring relationships in my data. The data on Executive Dysfunction comes in two forms:

a) category of t-score for individual variables: highly elevated, moderately elevated or non-elevated

b) raw scores on a quantitative scale (summarized as two subtotals: the behavioural rating index (BRI) and the metacognition index (MI)).

What are the first steps in assessing

i) the association between category of t-score and category of ultrasound scan (obtained at infancy as ‘pathology’ or ‘no pathology’) and ii) the correlation between the BRI and the MI.

A. In order to eyeball associations between two groups of categorical data, it is extremely useful to consider stacked barcharts. These can help you decide whether there is evidence of an association between the two groups and thus whether it is worthwhile going forward with a Chi-Square test of association.

With quantitative data, associations can be of many forms and scatterplots are a great asset here, as these can help you decide whether your data show a linear pattern and therefore whether you are justified in using a Pearson Correlation Coefficient to measure the strength of a linear association. Further advice on the assumptions that need to be tested for use of and choice between different correlation coefficients is available under CORRELATION COEFFICIENTS – LINEAR AND NON-LINEAR.

Scatter-plots are easy to construct in SPSS. To learn more, see the guide A Simple Scatterplot Using SPSS.

With regards to creating percentage stacked barcharts, in order to ensure that your chart is complete and self-contained, you are recommended to consider the presentation provided in various file formats below.

This presentation is provided for efficiency and with your best interests in mind and combines background theory and practical steps in SPSS, while filling in the gaps which appear in textbooks, thus saving you disappointments in the longer term! The presentation relies on a syntax file to enable you to construct percentage stacked bar-charts using IBM SPSS 19.0 AND LATER versions of SPSS.

Syntax file for creating percentage stacked bar-chart using IBM SPSS 19.0 or later versions of SPSS

Instructions for using the syntax file are provided within the presentation. In later versions of SPSS, including version 27, functionality has been enhanced for creation of the above sort of chart and the syntax provided above will no longer work.  If you are using these later versions, you should find the instructions provided below the presentation work very well in achieving the same chart.

The presentation title is The chi-square test of association, the percentage stacked bar chart, Fisher’s exact test, odds ratios and relative risks (PowerPoint version: designed to help you learn step by step) 

Here is the presentation:

Loader Loading…
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

To assist you in engaging effectively with the above resource, please use the accompanying practise data. This ought to build up your confidence as you replicate the findings from the worked examples and visualize the findings through doing the work yourself.

Instructions for creating a percentage stacked barchart in later versions of SPSS (versions 27 and beyond)

Here is the link to the relevant step-by-step instructions (which you can adapt for use with the above practise data):

https://ezspss.com/how-to-create-a-stacked-bar-chart-in-spss/ .

 

Here are a few tips to make sure things go smoothly for you:

  1. On working with the dialogue box at step 4, make sure that the option ‘No. of cases’ is selected under ‘Bars Represent’.
  2. On following the important instruction at Step 9., refer to the menu ‘Options’ to find the recommended option.
  3. At this stage, you can also right-click on one of the bars of the chart and select the option ‘Show data labels’ so that you can display the observed counts (or, observed frequencies) for your data in an entirely similar way to that displayed in course handout.
  4. The above instructions are for use with a Windows operating system, so if you are using a MacBook, you may need to adapt them accordingly.

 

 

· Q 6. My scatter plot has overlapping points. Can I use SPSS to highlight overlapping points in such a way that their frequency for any co-ordinate pair is evident from my scatter plot?

A.  The best package readily available at the University for addressing this need is Minitab. Minitab uses a procedure called jittering to randomly spread out the overlapping points around but close to the original position, so that the reader can be alerted to the overlap. You should first create a scatter-plot in Mintab and then apply the jittering effect. Here is what to do to find the necessary resources:

Creating a scatter-plot with jittering in Minitab

1. Go to the menu Help in Minitab and select  the menu item ? Help.

2.  Select the header Graph Menu from the boxes in the middle (Minitab Help)  pane.

3. Select Scatterplot from the list of available options.

5. You will presented with the list

overviews   how to   examples   data   see also

of menus. 

6. Use the first three menus to familiarize yourself with creating a scatter-plot in Minitab and to create your own corresponding scatter-plot.

7. When you have completed the above, choose the option

A. Yes, please consider using SPSS instead (see Q. 8, below).  For a clear explanation of the pitfalls of using Excel for creating histograms, please refer to Beware of Excel Histograms.

A. Instead of  providing a frequency count for the data binned into each range of values, the dotplot will also display each point visually, thus offering a different way of displaying the density of the data within different value ranges. After creating the chart in raw form, you can double-click on the chart window and then right-click with your mouse to obtain a drop-down menu which allows you to select the option ‘Show Distribution Curve’. This option allows you to experiment with a variety of options to enable you to fit the most appropriate curve to your data. See the resource Scatterplots and dotplots for advice on simple steps for constructing dotplots in SPSS.

A. The type of plot you need is a matrix plot. Matrix plots are simple to create. Instructions are available from How to Make a Scatter Plot in SPSS or PASW Statistics.

A. Please refer to Chapter 4 of Andy Field’s book Discovering Statistics with SPSS. You should find page 5 to 8 most helpful.

· Q 12. Once I have created a graph in SPSS, can I manipulate the scales on the axes to my own specifications?

A. Yes.  To learn more about editing charts in SPSS, please refer to Chapter 6 of IBM Statistics 21 Brief Guide.

· Q 13. I would like to generate a boxplot for my data but I am unclear about what the various components of a box-plot stand for. Can you point me to a resource that would enlighten me in order to that I can report on my own findings more instructively?

A. Certainly! Note here and later on this page that the type of graph referred to on this page as a boxplot is also sometimes referred to as a  ‘box plot’, ‘box-and-whisker plot’ or ‘box and whisker plot’.
A boxplot is a very useful chart to enable you to compare the distribution of your data across multiple groups in terms of its variability, outliers and medians, where the latter are a measure of central tendency for your data. However, in order to get on top of the relevant concepts and  and familiarize yourself with the anatomy of a boxplot, you are recommended to consult  resource on box-plots. The ‘o’s may be regarded as fairly harmless outliers and it is best to try to avoid removing them. By contrast the ‘*’s (asterisks)  are more extreme outliers and may need to be removed before attempting further analyses. Within the second of these two resources, the descriptions of a boxplot are particularly useful. However, if you are using IBM SPSS 19.0 or later, you are advised to refer to Q.’s 14 and 15, below for instructions on how to create boxplots in SPSS.

· Q 14. I am engaged in a study assessing the quality of a new intervention to improve patients experiences of colonoscopy and am using a validated comfort scale to obtained patient feedback. How can I graphically represent comfort scores across treatment and placebo groups in such a way that the reader can compare median scores, upper and lower quartiles and within-category variability of scores across groups?

A. A simple box-plot would do this very nicely. You are recommended to take a good look at the resources under the solution Q. 13 in order to learn more about this type of plot before attempting to create one for your data.

You can then in turn refer to the box-plot movie for creating your box-plot in SPSS, where you will find that the particular kind of box-plot which you are interested in is covered under the second example. You may find it helpful to view the entire movie, however, as this will help reinforce your learning. Please consider bearing in mind the points below when viewing the movie. For example, if you are dealing with outcome variables (such as pain scores) in separate columns, see item 4) below first of all.

1) when writing up your report, data should be referred to in the plural (“data are”) rather than in the singular (“data is”).

2) Once you have enhanced the appearance of your box-plot to your own satisfaction and copy-pasted the corresponding plot into your report, you should also consider annotating the plot to indicate how many subjects are included for each category. This can be accomplished by including text boxes including text, such as ‘n = 32’, ‘n = 17’ etc. This is actually rather important, as a  relatively large amount of variability for a given category may be partly the result of a smaller sample size and not merely because, for example, you are considering the treatment rather than the placebo group.

3) Box-plots of the above sort are suitable for comparing two or more groups and indeed, can be created to consider a single group of patients (simply by omitting to include a group variable when following the instructions in the movie).

4) Notice that in the above movie it is assumed that your data are from independent groups and that you have a group column in your spreadsheet to represent these groups. Where you wish to consider related groups, e.g. the same patients at the start and end of an intervention, you should find the instructions under SPSS boxplot with multiple variables  provides you with the necessary instructions for generating your box-plot in SPSS.  Here it is assumed that you want to create a simple boxplot. However, if you want to add in an extra dimension, you may wish to create a clustered box-plot instead. For example, you may wish to compare across the levels (e.g. before and after treatment) of a dependent variable (e.g. time) and an independent variable (e.g. treatment group). In this case, view the above video but make sure that you choose the option ‘Clustered’ rather than ‘Simple’ close to the start of following the instructions. This will allow you to have an area ‘Category axis’ in the corresponding SPSS dialogue box, so that you can add in your group variable.

· Q 15. I am engaged in a study involving the use of anaelgesics with cancer patients. Patient experiences are to be recorded using a patient pain scale. How can I graphically represent pain scores from this scale according to drug administered and gender for cancer patients in such a way that the reader can compare median scores, upper and lower quartiles and within-category variability of scores across drug and gender?

A. A clustered box plot would do this very nicely. As your pain scores are used to compare independent groups, they are in a single column. Therefore, please refer to the box-plot movie, where you will find that the particular kind of box-plot which you are interested in is covered under the third example. You may find it helpful to view the entire movie, however, as this will help reinforce your learning. 
If, instead, you wish to compare pain scores for the same patients at different time points, your pain scores are likely to be recorded in separate columns. In this case, you should find the simple instructions at  Obtaining clustered boxplots for related samples useful.  Note that in this case, the ‘Boxes represent’ field applies to the separate columns for pain scores, while the ‘Category axis’ field applies to drug administered.

Please also refer to points 1) and 2) under Q. 14. Further, a clustered box-plot is designed to split your data in two directions and therefore is only useful in practise where you have sufficient data in the resultant sub-groups for this to make sense. You may wish to explore with simple and clustered box-plots before making your final choice(s) as to what to include in your report.

· Q 16. Where can I find some helpful advice on creating pie-charts in SPSS?

Please refer to the syntax file below.

If you run this syntax in SPSS, you will generate a simple pie-chart for political views and a pair of pie-charts with political views split according to gender (a panel pie-chart).  Should you wish to create a panel chart, you can easily edit the file to suit your needs and then simply select ‘All’ from the menu ‘Run’ to get your chart in raw form. Please bear in mind that the changes you need to apply are very simple. In particular, replace the two occurrences of the variable name ‘ed’ by the name of the variable you wish to slice by and  the two occurrences of the variable name ‘default’ by the name of your splitting (or, panelling)  variable, should you wish to create panelled pie-charts. (In the example provided in the above resource, this would entail replacing ‘ed’ by ‘Political view’ and ‘default’ by ‘Gender’.)

In turn, if you don’t wish to split according to any variable (i.e., you wish to create a pie-chart with no panelling (a simple pie-chart), simply delete the two rows in their entirety which include the variable name ‘default’. Once you have run the syntax, you can edit your raw chart and apply some cosmetic surgery! Just double-click on the chart areas and then double-click on the specific regions of the chart you wish to alter.

Syntax file for creating pie-charts.

For further practise, it would be a good idea to work with the spreadsheet provided below. Suppose you wish to compare the views of consultants and registrars with respect to the effectiveness of a particular intervention in the treatment of end-stage cancer patients. If you open up the spreadsheet, you will see that the variable you wish to slice by is called ‘effectiveness’ while you could also use the variable entitled ‘staff-grade’ as a panel variable. Have a go at editing the syntax file accordingly with the help of the instructions above and then run the resultant syntax after you have saved the new syntax file within your private directory. 

SPSS data for comparing clinician views

As with your charts in SPSS, you can apply some cosmetic surgery to the chart in its raw form so as to create the final product for a report.

· Q 17. Where can I learn about good approaches for inserting graphs from Excel or SPSS into MS Word documents?

A. For advice on copying Excel graphs, please refer to Microsoft Word 2010 – Import a chart from Excel. When following the instructions provided, take time out to explore the effects of choosing the different Paste Special and see which is best suited for you. For advice on importing SPSS graphs (and tables), please refer to p. 13 of Introduction to IBM Statistics 19.

. Q 18. I would like to find a suitable chart to display the performance of different consultants according to a Likert scale across different dimensions, including knowledge, friendliness, time-keeping, clinical skill and clarity. It would be helpful to concisely consider their relative strengths across the different dimensions. How should I proceed?

A. A radar chart may serve you well in this case. Have a look at a video using an analogous example here

CC BY-NC-ND 4.0 Graphical Presentation of Data by Margaret MacDougall is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

The WordPress site for supporting undergraduate medical student learning in statistics for short research projects

  • If you are visiting StatsforMedics for the first time, welcome!
  • Please take time to visit the page SCOPE OF SITE (see menu bar, below) for advice on how to make best use of the site and how to contact me.
  • University of Edinburgh undergraduate medical students: feel free to contact me if you need further assistance with your *curricular* activities.