SSCI2020 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.

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

Figure 1: <Figure 1>

Or click the icon of OPEN at the top bar.

<Figure 2>

Figure 2: <Figure 2>

  1. In the window of Open Data, go to a folder in which your saved your data file in the workshop 1 (It is SSCI2020 folder. Google Drive >> My Drive >> SSCI2020) and choose your data file. Click Open.
<Figure 3>

Figure 3: <Figure 3>

  1. You will see the Output window telling your dataset is loaded successfully. Minimise the Output window or come back to Data Editor using Switch Window icon in the navigation toolbar (See Swiwtch Windows). You will see your dataset loaded in Data View.
<Figure 4>

Figure 4: <Figure 4>

Making a frequency table.

Let’s make a frequency table of gender.

  1. Go to Analyze > Descriptive Statistics > Frequencies.
<Figure 5>

Figure 5: <Figure 5>

  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.
<Figure 6>

Figure 6: <Figure 6>

  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.
<Figure 7>

Figure 7: <Figure 7>

  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….

<Figure 8>

Figure 8: <Figure 8>

  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.
<Figure 9>

Figure 9: <Figure 9>

  1. In the box of Save File, choose the SSCI2020 folder in Look in and type file names. Click Save.
<Figure 10>

Figure 10: <Figure 10>

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

  2. Click My Files icon in the navigation toolbar.

<Figure 11>

Figure 11: <Figure 11>

  1. Go to Google Drvie >> My Drive >> SSCI2020. Then, you will see “Frequency-gender.doc” file. Click “Frequency-gender.doc”. This file will be downloaded to your computer.
<Figure 12>

Figure 12: <Figure 12>

  1. Open the downloaded file in MS Word at your local computer. You will see the frequency table in MS Word. You can copy this table and paste it to any other documents (i.e. your final survey report).
<Figure 13>

Figure 13: <Figure 13>

Workshop 2 Participation Activity

  1. Make a frequency table of polorient. How many respondents define themselves as Right? Please report just the number.


  1. Make a frequency table of class. What percentage of respondents define themselves as Upper middle class? I recommend you to report a VALID percent. Please report just the number (e.g., If you get 15.6%, report 15.6). Do not include % in the answer.


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.
<Figure 14>

Figure 14: <Figure 14>

  1. In the popped-up box, you will see gender is already in the section of Variable(s) becuase SPSS remember what you did for making a frequency table. I recommend you to click Reset at the bottom when you start a new analysis. So, please click Reset at the bottom. Then you will see <Figure 15>. 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.
<Figure 15>

Figure 15: <Figure 15>

  1. Now, you will see the selected variable in the pane of Variable(s). Click Charts.
<Figure 16>

Figure 16: <Figure 16>

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

Figure 17: <Figure 17>


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

<Figure 18>

Figure 18: <Figure 18>


  1. You will be back to the previous Frequencies box. Click OK.
<Figure 19>

Figure 19: <Figure 19>

  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.
<Figure 20>

Figure 20: <Figure 20>

  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.
<Figure 21>

Figure 21: <Figure 21>

  1. Now, you will see the frequency of male and female category.
<Figure 22>

Figure 22: <Figure 22>

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.
<Figure 23>

Figure 23: <Figure 23>

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

Figure 24: <Figure 24>

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.
<Figure 25>

Figure 25: <Figure 25>

  1. In the box of Frequencies, click Reset at the bottom again. 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.
<Figure 26>

Figure 26: <Figure 26>

  1. Click Charts.
<Figure 27>

Figure 27: <Figure 27>

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

Figure 28: <Figure 28>


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

<Figure 29>

Figure 29: <Figure 29>


  1. You will be back to the previous Frequencies box. Click OK.
<Figure 30>

Figure 30: <Figure 30>

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

Figure 31: <Figure 31>

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 using 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.
<Figure 32>

Figure 32: <Figure 32>

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

Figure 33: <Figure 33>

  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.
<Figure 34>

Figure 34: <Figure 34>

  1. In the Output window, you will see the grouped bar graph.
<Figure 35>

Figure 35: <Figure 35>

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.
<Figure 36>

Figure 36: <Figure 36>

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

Figure 37: <Figure 37>

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

Figure 38: <Figure 38>

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

Figure 39: <Figure 39>

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

Figure 40: <Figure 40>

  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.
<Figure 41>

Figure 41: <Figure 41>

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

Figure 42: <Figure 42>

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.
<Figure 43>

Figure 43: <Figure 43>

  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.
<Figure 44>

Figure 44: <Figure 44>

  1. You will see the histogram of age in the output window.
<Figure 45>

Figure 45: <Figure 45>

Workshop 2 Participation Activity

  1. Make a stacked bar chart of class by gender. Based on the stacked bar chart you created, which of the following is NOT true? (Tip: Adding the percentage to the chart would make the comparison easier. See the step 7 - 11 in Producing a pie chart)
  (1) A higher percentage of lower class people is found in male respondents than in female respondents.
  (2) A higher percentage of working class people is found in male respondents than in female respondents.
  (3) A higher percentage of middle class people is found in male respondents than in female respondents.
  (4) A higher percentage of upper middle class people is found in male respondents than in female respondents.


Note: You can find the link to the Workshop 2 Participation Activity on the iLearn (under the section of Week 3).


Last updated on 27 September, 2022 by Dr Hang Young Lee(hangyoung.lee@mq.edu.au)