3. Basic Components of SPSS Statistics
3.1 Output Viewers
The outputs created by the program are displayed in the “SPSS (PASW) Statistics Viewer”. By default, all outputs including command syntax used during the analysis, output tables, charts, notes and the activity logs during the session are recorded in the Viewer. Users are allowed to determine which output items they wish to display or hide in the viewer. These options can be set through the ‘Viewer’ tab in the ‘Options’ sub-menu of the ‘Edit’ menu.
If SPSS is launched by opening a data file, a Viewer (with the name Output1 [Document1]) will be automatically activated and record the command syntax used to open the data file under the ‘Log’ tag. If the user decides not to show the command syntaxes in future, the user can set the ‘Log’ to be ‘hidden’ initially. Otherwise, the log will be displayed when opening a data file.
When running a cross-tabulation (crosstab) of “highest education level” by “sex”, a typical Viewer is displayed as in the following illustration. Six types of outputs are recorded in the Viewer: (i) Command Log; (ii) Title; (iii) Notes; (iv) Active Data set; (v) Case Processing Summary; and (vi) The output table (Highest educational level X Sex of household member cross-tabulation).
SPSS (PASW) Statistics Viewer is especially useful for:
- browsing the results in a window that operates like Windows Explorer.
- showing or hiding selected output item (notes, tables and charts).
- deleting selected output items.
- changing the display order of results.
- moving items between the Viewer and other applications.
In the viewer, double-click the appropriate icon in the left pane to show any hidden item. Double-clicking the icon when an item is visible, it will become hidden. For example, notes are hidden by default in outputs, but you can double-click the notes icon to display the notes.
You can change the order of icons in the left pane by using the mouse to drag-and-drop the icons in their new position. Click the icon to activate the associated item, and press “delete” key to remove that item (and its icon) from the output.
3.2 Pivot Tables
Pivot tables are a tool for summarising data. Pivot tables are used to present output using alternative table display formats. For example, users can change the variables that are displayed in rows to columns and vice versa. The ability to rotate data is known as ‘pivoting’ and a table with this ability is called a ‘pivot table’. One of the significant features of SPSS Statistics Viewer is its ability to handle pivot tables. Pivot table tools can automatically sort, count, and calculate totals of the data stored in one table or spreadsheet to create a second table.
Most of the output tables in the Viewer can be pivoted interactively. The user has the choice to setup and change the table structure by dragging and dropping the variables or by selecting the specific items to choose whether to display the entire data set, or just a subset of the data.
Options for manipulating a pivot table include:
- transposing rows and columns;
- moving rows and columns;
- creating multidimensional layers;
- grouping and ungrouping rows and columns;
- showing and hiding rows, columns, and other information;
- rotating row and column labels; and
- finding definitions of terms.
The followings illustrate how one can use pivoting for data analysis and presentation.
First, run a cross-tabulation of “educational attainment” by “sex” by “type of place of residence” (click Analyze on Main Menu and select Crosstabs under Descriptive Statistics, then, select the variable, click appropriate variable name on the left to move to row or column or layer following the example arrows, and finally click OK – see a detail illustration in the next module).
The main results obtained by the cross-tabulation command include the following table.
Then, go through the following steps for pivoting an output table:
1) Double-click the output table located in right result pane to switch to table editing mode.
2) The main menu will contain a new item ‘Pivot’.
3) Select ‘Pivot’ menu and click ‘Pivoting Trays’.
4) In the pivot tray, arrange the row, column and layer variables (including statistics) as necessary by dragging-and-dropping the variable names,
The examples below illustrate the use of the pivot table method on the crosstab table.
3.3.1 Creating Charts while Analysing Data
SPSS can create high-resolution charts with a single click, even while performing other procedures in the ‘Analyze’ menu. For example, in the bottom-left area of “Crosstab” command, there is a checkbox ‘Display clustered bar charts’ that we can use to create graphs of selected variables.
3.3.3 Creating Chart using the Chart Builder
Different types of charts and plots can be produced by the procedures in the ‘Chart Builder’ item under the ‘Graphs’ menu. The Chart Builder helps us build charts from a pre-defined gallery of charts (using templates or samples) or from the individual parts (axes and bars). A chart can be built by dragging and dropping the gallery charts or basic elements onto the canvas, which is the large area to the right of the Variables list in the Chart Builder dialog box. When building a chart, the canvas will display a preview of the chart with defined variable labels and measurement levels. The preview does not reflect the actual data since it uses randomly generated data to provide a rough sketch of how the chart will look like.
New users may prefer to use the Chart Gallery to construct their charts. It is also possible to build a chart from basic elements, but this is more complex since the users must explicitly define options for the charts.
Construct a chart by using the Chart Gallery
First, click the ‘Chart Builder’ item under the ‘Graphs’ menu. The following Chart Builder window and a warning dialogue box will appear. Click OK, since users can define temporary variable types while building charts.
Then, follow the steps below to build a chart from the gallery:
- Click the ‘Gallery’ tab (if the gallery is not already being displayed).
- In the ‘choose from’ list, select a chart category. Each category offers several types.
- Select a chart type by dragging it onto the canvas, or by double-clicking the picture of the desired chart type. If the canvas already displays a chart, the new chart from the gallery will replace the axis set and graphic elements on the existing chart.
- Drag variables from the ‘Variables’ list and drop them into the axis drop zones and, if available also into the grouping drop zone. If an axis drop zone already displays statistics, and if it is the statistics desired, do not drag a variable into the drop zone. Add a variable to a zone only when the text in the zone is blue. If the text is black, the zone already contains a variable or statistics. Refer to Statistics and Parameters for information about the available statistics.
While building the charts, the measurement level of variables is important. The Chart Builder sets defaults based on the measurement level while building the chart. The resulting chart may look different for various measurement levels. The user can temporarily change a variable’s measurement level by right-clicking the variable and choosing an option.
- If the user needs to change statistics or modify attributes of the axes or legends (such as the scale range), click ‘Element Properties’. In the ‘Edit Properties Of’ list, select the item that needs to change and make the required changes. After making any changes, click ‘Apply’.
- Click OK to create and display the chart in the Viewer.
- If it is necessary to add more variables to the chart (for example, for clustering or panelling), click the ‘Groups/Point ID’ tab in the Chart Builder dialog box and select one or more options. Then drag categorical variables to the new drop zones that appear on the canvas.
- To transpose the chart (for example, to make the bars horizontal), click the ‘Basic Elements’ tab and then click ‘Transpose’.
- If many default settings for a specific chart have been changed, the current settings maybe saved as a favourite to be re-used later. Please refer to SPSS manuals for detailed instructions.
- The canvas is the area of the Chart Builder dialog box where we build the chart.
- An axis set defines one or more axes in a particular coordinate space (like 2-D rectangular or 1-D polar). Adding a gallery item to the canvas automatically creates an axis set. Each axis includes an axis drop zone for dragging and dropping variables. Blue text indicates that the zone still requires a variable. Every chart requires a variable to the x-axis drop zone.
- The graphic elements are the items in the chart that represent data. These are the bars, points, lines, and so on. In the illustration, the graphic element is a bar.
- The variable list displays the available variables. If a variable selected in this list is categorical, the category list shows the defined categories for the variable. A variable’s measurement level can be changed temporarily by right-clicking its name and choosing desired measurement level.
- Drop zones are the areas on the canvas in which variables from the variables list can be dragged and dropped. The basic drop zone is the axis drop zone. Certain gallery charts (like clustered or stacked bar charts) include grouping drop zones. The above illustration shows a grouping zone that uses ‘Sex’ as the grouping variable.
To generate a bar chart of the “percentage of male and female head of household in each district”, first, click the ‘Element Properties’ button on the Chart Builder window and follow the steps:
1) In the ‘Element Properties’ window, change the desired statistics to ‘Percentage()’.
2) Click the ‘Set Parameters’ button.
3) Select ‘Total for Each X-Axis Category’ as the denominator for computing percentage using the set parameters drop-down list.
4) Click ‘Continue’.
5) Click ‘Apply’ to activate changes
And, finally, click OK button on the Chart Builder window. The following graph will be displayed.
3.3.3 Using Graphboard Visualization to create customised graphs
Creating a graph from the “Graphboard Template Chooser”
This is a new feature in SPSS (PASW) Statistics 17. Through this command (located in the ‘Graph’ menu), graphs can be created from ready-made templates called ‘Graphboard Visualizations’ that contains graphs, charts, and plots. SPSS Statistics ships with built-in visualisation templates that cover 23 different types of graphs, which is a sufficient range for most users. Another product, Viz Designer, allows users to create their own visualisation templates.
To use the built-in templates, select ‘Graphboard Template Chooser’ in the ‘Graph’ menu and follow these steps:
- In the ‘Graphboard Template Chooser’ window, click the ‘basic’ tab to start selecting the appropriate variable(s).
- Click the variable name(s) to create a graph (for more than one variable, hold down the CTRL key as you click to select additional variables). SPSS displays a list of variable names, instead of labels. As soon as a variable is selected, all graph types that are compatible with the selected variable will be displayed in the right pane of the window. Similarly, if two variables are selected, all the possible chart types for those two variables will be displayed.
- Double-click the icon of the preferred graph type from the displayed samples;
- Then (optionally), click:
- the ‘Detailed’ tab to change chart type, variables, etc.
- the ‘Titles’ tab to set chart title, sub-title and footnote.
- the ‘Options’ tab to set output label and other options.
- Click OK to create the graph.
Graphs that are created through SPSS “Graphboard Template Chooser” require more resources, such as a faster processor and more memory to render. Moreover, graphs created using the “Graphboard Template Chooser” are difficult to edit.
3.3.4 Graphs through Legacy Dialogs
Graph can also be created from the “legacy dialogs”. Almost all graph types are available and can be created with customised elements, such as the title sub-title and so on. The exhibit below shows examples of the types of graphs that can be created using ‘Legacy Dialogs’. An example below shows the population pyramid of a sample household population created using the legacy dialogs.
The following dialog shows how a population pyramid of age and sex can be generated from a household survey.
And, the pyramid produced by the above setting is as follows:
3.4 Saving and Exporting Outputs
Outputs in the Viewer can be exported to different formats such as: Excel (*.xls); HTML (*.htm); Portable Document Format (*.pdf); Power Point (*.ppt); different text formats (*.txt) such as plain text, UTF8 and UTF16; and Word/RTF (*.doc). Moreover, graphical outputs can be saved into such formats as: Bitmap (*.bmp); Enhanced Meta File (*.emf); Encapsulated Postscript (*.eps); JPEG file (*.jpg); Portable Network Graphic (*.png); and Tagged Image File (*.tif).
Starting from SPSS (PASW) Statistics 16, outputs are saved only in Viewer format (*.spv). The SPSS viewer no longer supports the export of files for earlier versions in the proprietary file format (*.spo). From SPSS Viewer, outputs can be selected, copied and pasted into any spreadsheet software, word processors or graphical presentation software.
While exporting outputs, one can select:
- to export all items, including hidden items, and both selected items and non-selected items;
- visible (non-hidden) items only; or
- only selected items.
For exporting multiple items, users can select more than one item by clicking items while pressing <CTRL> key, and then follow the steps below.
For exporting SPSS outputs to Microsoft Excel,
1) Select the item(s) to export on the left pane of the SPSS Statistics Viewer.
2) Click ‘Export’ in File Menu and an ‘Export Output’ window will appear.
In the ‘Export Output’ window:
1) Check the “Selected” option button to export only selected output items (tables, notes and summaries).
2) Select ‘Excel file (*.xls)’ from the ‘File Type’ dropdown.
3) Click the ‘Browse’ button and select the location of the export file and file name, or type in the file name with full path, e.g., “C:\Documents and Settings\User\My Documents\SPSS Training\Sample\Test-exporting.xls”.
4) Click OK to export the output.
Once the export is complete, the file will be displayed in the designated folder.
To export graphics without any notes, tables, or other elements, select ‘None (Graphics only)’ while choosing the Document Type in Step 4 (it’s the last item in the drop-down list). The ‘Graphic’ section of the ‘Export Output’ window will be activated and the ‘Document’ section will be de-activated (that is, user can no longer set any options other than select a document type). In this case, users can select the graphic format (together with graphic options) to be saved and the file name of graphics. If the root file name is “text.png” and if there are three charts in the active Viewer, then three graphic files will be created with the names ‘test1.png’, ‘test2.png’, and ‘test3.png’.
3.5 Online Help
SPSS provides a comprehensive help system and a tutorial for every key function. Context-sensitive help, which is available in each dialog box, provides guide for every task. A help window will pop-up whenever the help key ‘F1’ is pressed. It shows the base system help while working with data editor or output viewer, or command syntax guide while working in the syntax editor. Similarly, various types of help can be accessed through the ‘Help’ menu.
The first item in the help menu is the ‘Topics’ item. ‘Topics’ provides access to the basic Help system with Contents, Index, and Search tabs. From ‘Topics’ users can find the explanations of specific topics or command procedures.
The second item, ‘Tutorial’ provides step-by-step instructions for how to use many of the basic features in SPSS. Users can choose tutorials from a list of topics they wish to learn. Users can skip around and view topics in any order they choose. The index or table of contents can be used to find specific topics. The third item on the menu ‘Case studies’ provides hands-on examples of how to perform various types of statistical analyses, and how to interpret the results. The sample data files used in the examples are provided with the SPSS software.
Table of contents of the tutorial can be observed in the following illustration.
The “Statistics Coach”, use a wizard-like approach, to help users find the commands or procedures they need. After the user has made a series of selections, the Statistics Coach opens the appropriate reporting or charting dialog box that meets the users’ criteria. The Statistics Coach provides access to most statistical and reporting procedures and several charting procedures in the Base system.
The help items mentioned above are useful for all users – from beginners to advanced developers. Apart from those, more help systems such as ‘Command Syntax Reference’ and ‘Statistical Algorithms’ are available for advanced users. The ‘Developer Central’ and ‘Technical Support Website’ are available through the SPSS website.
Like in other modern software, SPSS provides “Context-sensitive Help” in several places in the user interface as:
1) Most dialog boxes have a ‘Help’ button that jumps directly to a Help topic for that dialog box. The Help topic provides general information and links to related topics.
2) Right-click terms in an activated Pivot Table in the Viewer and choose ‘What’s This?’ from the context menu to display definitions of the terms.
3) In a command syntax window, position the cursor anywhere within a syntax block of a command and press F1 on the keyboard. A command syntax chart will be displayed. Complete command syntax documentation is available from the links in the list of related topics and from the Help system’s ‘Contents’ tab.