Tutorial: Analyzing with SPSS Statistics
This tutorial describes how to use IBM® SPSS® Statistics to analyze data that is stored in a Db2® database.
You can view a video version of this tutorial here.
This tutorial shows you how to carry out the following tasks:
- Connect your database to SPSS Statistics.
- Prepare an analysis.
- Analyze data.
Time required5 minutes
You are a data scientist working for a sporting goods manufacturer. You want to know where the stores that sell the products of the sporting goods manufacturer are located. This scenario uses sample data that is already loaded into your Db2 database.
Connect your database to SPSS Statistics
Prepare the analysis
About this task
After you successfully establish the database connection, you can start to prepare the analysis by identifying the correct data and structuring it. Follow these steps to prepare the data for the analysis:
- In the Database Wizard, click Next to display a list of the tables in the database.
Follow these steps to get a separate entry for each retailer site:
- From the Available Tables list, select GOSALESRT.RETAILER_SITE.
- Expand GOSALESRT.RETAILER_SITE.
- Select RETAILER_SITE_CODE.
- Move RETAILER_SITE_CODE to the Retrieve Fields in this Order list by clicking the button with the right-pointing arrow.
Follow these steps to find out in which countries the retailers are located:
- From the Available Tables list, select GOSALES.COUNTRY.
- Expand GOSALES.COUNTRY.
- Select COUNTRY_EN.
- Move COUNTRY_EN to the Retrieve Fields in this Order list by clicking the button with the right-pointing arrow.
Join GOSALESRT.RETAILER_SITE and GOSALES.COUNTRY on the columns that they have in common by
following these steps:
- Click Next to open the Specify Relationships page in the Database Wizard.
- Select COUNTRY CODE from the GOSALES.COUNTRY list.
- Select RTL COUNTRY CODE from the GOSALESRT.RETAILER_SITE list.
- Select Inner from the Join Type list.
- Click Join.
- Click Finish to create a table that contains a separate entry for each retailer site and the country in which the retailer site is located.
Analyze the data
Finally, let's analyze the data and visualize the results of the analysis. Follow these steps:
- In the IBM SPSS Statistics Data Editor, click to open the Frequencies window.
- In the Frequencies window, select COUNTRY_EN to count the number of retailer sites in each country.
- Move COUNTRY_EN to the Variable(s) list by clicking the button with the right-pointing arrow.
- Click Charts to open the Frequencies: Charts window.
- In the Chart Type section of the Frequencies: Charts window, click Bar charts to visualize the result with a bar chart.
- Click Continue to confirm your selection.
In the Frequencies window, click OK to analyze the
The result of the analysis is displayed in the IBM SPSS Statistics Viewer window. The IBM SPSS Statistics Viewer window contains a table that shows the distribution of the retailer sites in various countries. This table shows the total numbers and the percentages.
Table 1. The output table (Country) Frequency Percent Valid Percent Cumulative Percent Valid Australia 20 2.5 2.5 2.4 Austria 25 3.0 3.0 5.3 Belgium 20 2.4 2.4 7.7 Brazil 16 1.9 1.9 9.6 Canada 56 6.6 6.6 16.2 China 35 4.1 4.1 20.3 Denmark 17 2.0 2.0 22.3 Finland 19 2.2 2.2 24.6 France 64 7.6 7.6 32.1 Germany 61 7.2 7.2 39.3 Italy 30 3.5 3.5 42.9 Japan 66 7.8 7.8 50.6 Korea 20 2.4 2.4 53.0 Mexico 17 2.0 2.0 55.0 Netherlands 33 3.9 3.9 58.9 Singapore 28 3.3 3.3 62.2 Spain 21 2.5 2.5 64.7 Sweden 26 3.1 3.1 67.8 Switzerland 35 4.1 4.1 71.9 United Kingdom 57 6.7 6.7 78.6 United States 181 21.4 21.4 100 Total 847 100 100Note: The layout of the actual SPSS output table differs slightly from what is shown here. The output shown here was reformatted to make it easier to read.
The IBM SPSS Statistics Viewer window also contains a bar chart, which visualizes the result. This bar chart shows that, by far, most retailer sites are located in the United States.