SSCI202 Workshop 2: Visualising Data

Preparation: Opening a data file

In the first workshop, you constructed an SPSS dataset of 30 respondents. We continue working on this data file. Therefore, the first step is to open your data file in SPSS.


Note: If you are using SPSS via AppStream, you need to upload your SPSS data file from your local computer. Follow the instruction of How to upload your SPSS work files to AppStream.


  1. To open a data file, go to File > Open > Data.

Or click the icon of OPEN at the top bar.

  1. In the window of Open Data, go to a folder in which your saved data file (in case you are using SPSS via AppStream, it is the Temporary Files folder) and choose it. Click Open.

  1. You will see the Output window telling your dataset is loaded successfully. Minimise the Output window. You will see your dataset loaded in Data View.

Making a frequency table.

Let’s make a frequency table of gender.

  1. Go to Analyze > Descriptive Statistics > Frequencies.

  1. In the box of Frequencies, right-click at the left variable pane. Choose Display Variable Names. Variable labels will be changed to variable names.

  1. Choose a variable you want to make a frequency table for (in this case, it is gender). And click the arrow in the middle. The variable will be moved to the right pane. Then, click OK at the bottom.

  1. SPSS will open the Output window in which the frequency table is displayed. The week 3 lecture slide helps you to read this frequency table.

  2. In the Output window, choose the table that you want to copy and then right-click. Select Export….

  1. In the box of Export Output, make sure that Objects to Export should be Selected and Document Type should be Word/RTF (*.doc).. Then, click Browse in the middle.

  1. In the box of Save File, choose a folder where you want to save files and type file names. Click Save.

  1. In the box of Export Output, click OK at the bottom.

  2. Open the saved file in MS Word at your local computer (If you are using SPSS via AppStream, you need to download it from AppStream. See How to download your work files from AppStream), you will see the frequency table. You can copy this table and paste it to any other documents (i.e. your final survey report).

Workshop Activity 2.1: Frequency Table

  1. Make a frequency table of polorient. How many respondents define themselves as Right?
  2. Make a frequency table of class. What percentage of respondents define themselves as Upper middle class?

Note: External students should post their answers to these three questions on the iLearn. This activity will contribute to your workshop participation marks.


Visualising data

The second task is to produce a number of useful graphics. Visualising variables provide an important “first look” of your data.

Producing a pie chart

A pie chart is a circular graph with slices that represent the proportion of the total contained within each category. Pie charts are preferred to visualise nominal as well as ordinal variables.

  1. To produce a pie chart, go to Analyze > Descriptive Statistics > Frequencies.

  1. In the popped-up box, select a variable for which you want to produce a pie chart and click the arrow in the middle. In this example, I will make a pie chart of gender.

  1. Now, you will see the selected variable in the pane of Variable(s). Click Charts….

  1. In the popped-up box, select Pie charts in Chart Type and Frequencies in Chart Values. Click Continue.


Note: If you select Percentages in Chart Values, the pie chart will show the percentage of each category of gender.


  1. You will be back to the previous Frequencies box. Click OK.

  1. In the output window, you will see the frequency table and pie chart of gender.

Note: The colour of slices in the pie chart could be different depending on the version of SPSS. But this difference does not affect the instruction of this workshop.


However, the pie chart you just produced does not provide information on the number (frequency) of males and females. Let’s add this information to the chart.

  1. At any place in the pie chart, right-click and choose Edit Content > In Separate Window.

  1. In the popped-up window, click the icon of Data Label Mode (see the below figure). Move your mouse cursor to a place where you want to put the number and click. You need to click on both green (female) and blue (male) areas. Then, you will see the frequency of male and female category.

  1. You will see the frequency of male and female category.

In the above figure, the size of numbers is too small. Let’s edit the font size for better readability.

  1. Click the icon of Data Label Mode again to go back to the edit mode. You will see a popped-up window of Properties. Click Close.

  1. Click any numbers (frequencies) in the pie chart. Choose font types and font sizes as you want. Then, close the window.

Producing a Bar Chart

A bar chart (also called a bar graph) is a graphical display of data using bars of different heights. Bar charts are preferred to visualise nominal or ordinal variables.

  1. Go to Analyze > Descriptive Statistics > Frequencies.

  1. In the box of Frequencies, choose a variable for which you want to produce a bar graph and click the arrow in the middle. In this example, we will make a bar graph of gender.

  1. Click Charts.

  1. In the box of Frequencies: Charts, select Bar charts in Chart Type and Frequencies in Chart Values. Click Continue.


Note: If you select Percentages in Chart Values, the bar chart will show the percentage of each category of gender.


  1. You will be back to the previous Frequencies box. Click OK.

  1. In the Output window, you will see the frequency table and bar chart of gender.

You can edit the bar chart in the same way you did for the pie chart.

Producing a grouped bar chart

Suppose that you want to compare the frequency of a variable by subgroups. For example, you may be interested in investigating how the distribution of political orientation differs by gender.

A grouped bar graph produces bars for every combination of categories (gender X political orientation) and then groups those bars by subgroups (gender), typically uing colored bars to represent a particular group. Therefore, a grouped bar graph provides an easy way to examine the relationship between two variables.

  1. To produce a grouped bar chart, go to Graphs > Legacy Dialogs > Bar.

  1. In the box of Bar Charts, choose Clustered and Summaries for groups of cases in Data in Chart Are. Click Define.

  1. In the box of Define Clustered Bar: Summaries for Groups of Cases, 1) choose a variable for which a bar is produced (in our example, it is political orientation) in the pane of Variables, and click the arrow in Category Axis, 2) choose a group variable by which bars are compared (in our example, it is gender), and click the arrow in Define Clusters by, 3) choose % of cases in Bars Represent (comparing the percentages makes more sense because the number of males and females are different), and 4) click OK.

  1. In the Output window, you will see the grouped bar graph.

Producing a stacked bar chart

A stacked bar chart provides an alternative way to compare the frequency of a variable by subgroups. In a stacked bar chart, parts of the data are stacked: each bar displays a total amount, broken down into sub-amounts. Again, we compare the distribution of political orientation by gender.

  1. To produce it, go to Graphs > Chart Builder.

  1. In the box of Chart Builder, tick the box of Don’t show this dialogue again and click OK.

  1. In the box of Chart Builder, click the icon of stacked bar chart. Drag and drop it to the upper white pane (see the below figure).

  1. Drag and drop gender to X-axis and political orientation to Stack: set color.

  1. In the pane of Element Properties, choose Bar1 in Edit Properties of: and Percentage(?) in Statistic.

  1. Click Set Parameters in Statistics. In the box of Element Properties: Set Parameters, choose Total for Each X-Axis Category in Denominator for Computing Percentage:. Click Continue.

  1. Click OK at the bottom. You will see a stacked bar chart of political orientation by gender.

Producing a histogram

Histogram displays a graphic representation of the distribution of a single continuous variable. It is a kind of bar chart used for displaying continuous variables. The difference is that in a histogram, the bars touch with each other. The widths of the bars represent the widths of the intervals, and the height of each bar represents the frequency of each interval. In this example, we will make a histogram of age.

  1. To create it, go to Graphs > Legacy Dialogs > Histogram.

  1. In the box of Histogram, choose a variable you want to plot (in this case, it is age) and move it to a pane of Variable: by clicking the arrow next to Variable:. Click OK.

  1. You will see the histogram of age in the output window.

Workshop Activity 2.2: Visualising Data

  1. Make a stacked bar chart of class by gender. Do you find any difference in the distribution of social class between men and women? If so, what do you find?

Note: External students should post their answers to these three questions on the iLearn. This activity will contribute to your workshop participation marks.


Last updated on 11 August, 2019 by Dr Hang Young Lee(hangyoung.lee@mq.edu.au)