Chapter 12
IN THIS CHAPTER
Working with the Graphs menu
Introducing Chart Builder
Using Graphboard Template Chooser
SPSS can display your data in a bar chart, a line graph, an area graph, a pie chart, a scatterplot, a histogram, a collection of high-low indicators, a box plot, or a dual-axis graph. Adding to this flexibility, each of these basic forms can have multiple appearances. For example, a bar chart can have a two- or three-dimensional appearance, represent data in different colors, or contain simple lines or I-beams for bars. The choice of layouts is almost endless.
The Graphs menu in the SPSS Data Editor window has three main options: Chart Builder, Graphboard Template Chooser, and Legacy Dialogs (the other options you see are Python plug-ins). These options are different ways of doing the same job. Legacy dialogs are the original graphs in SPSS and are the choice mainly of people who have been using them for years and who find changing to another option too much trouble. In this chapter, we work only with the other two alternatives.
Graphboard Template Chooser and Chart Builder go about creating graphs in different ways. In Graphboard Template Chooser, you first select the variables you want to display. Based on this information, different chart options are suggested. Chart Builder begins by presenting various chart types. After you select a chart, you specify which variables you will use.
Both graphing methods are popular, but if you build a lot of graphs, you may find advantages and uses for all of them. For the most part, you can get the same graphs from both options; only the process is different.
SPSS contains Chart Builder, which uses a graphic display to guide you through the steps of constructing graphs. It checks what you’re doing as you proceed and doesn’t allow you to use things that won’t work. Chart Builder has seven tabs, and we describe them all in this section.
The Gallery tab is the most common way to use Chart Builder. The following example takes you through the process of creating a bar chart, but you can use the same fundamental procedure to build any type of chart. Follow this tutorial once to see how it all works. Later, you can use your own data and choices.
Follow these steps to create a bar chart:
Choose File ⇒ Open ⇒ Data and load the GSS2012 Abbreviated.sav file.
To find the file, go to www.dummies.com/go/spss4e
.
Choose Graphs ⇒ Chart Builder.
A warning appears, informing you that before you use this dialog, the measurement level should be set properly for each variable in your chart. (We've set the correct measurement level, so you can proceed.)
Click OK.
The Chart Builder dialog appears.
In the Choose From list, select Bar as the graph type.
Various types of bar charts appear in the gallery to the right of the list, as shown in Figure 12-1.
Define the general shape of the bar graph to be drawn.
You can do this in two ways:
Figure 12-2 shows the appearance of the window after you've finished dragging, regardless of which method you followed.
You can always back up and start over anytime during the design of a graph. Simply click the Reset button. Anything you dragged to the display panel will be removed.
The Element Properties tab (see Figure 12-3) now appears to the right of the preview panel at the top. This tab lets you know which features of the element you can change. For example, you can change the statistic to display or the style of the bars. In this example, you don't use the Element Properties tab.
In similar fashion, select the Region of Interview (region) variable and drag it to the X-Axis label in the diagram.
The chart preview now looks like the one shown in Figure 12-4.
The graphic display inside the Chart Builder preview window never represents your actual data, even after you insert variable names. This preview window simply displays a diagram that demonstrates the composition and appearance of the graph that will be produced.
Click the OK button to produce the graph.
The SPSS Statistics Viewer window appears, containing the graph shown in Figure 12-5. This graph is based on the actual data. It shows that the average number of years of education varied little from one part of the country to the other in this survey.
These steps demonstrate the simplest way of generating a chart. We left out most of the options so we could demonstrate the simplicity of the basic process. (The result could also use a little editing to the y-axis; for details on editing, see Chapter 24.) The following sections describe the additional tabs available in Chart Builder.
The example in the preceding section used the Gallery tab to select the type and appearance of the chart. Alternatively, as mentioned, you can click the Basic Elements tab in the Chart Builder dialog and select the number of axes and elements you would like to include in the graph, as shown in Figure 12-6.
In the Basic Elements tab, you drag one element from the Choose Axes area to the panel on the top. Then drag another element from the Choose Elements area to the top. These elements combine to construct a diagram of the graph you want.
The result is the same as using the Gallery tab. The only difference is that you use the Basic Elements tab to build the graph from its components. Whether you use this technique or the Gallery tab depends on your conception of the graph you want to produce.
You’ve selected the type and appearance of your chart through either the Gallery tab or the Basic Elements tab. Next, click the Groups/Point ID tab in the Chart Builder dialog, which provides you with a group of options you can use to add more variables to your graphs.
In the example in Figure 12-7, we selected the Rows Panel Variable option, which generates a more complex graph. The new dimension adds a separate graph for whether the respondent uses a computer. A separate set of bars is drawn: one for those who use a computer, and one for those who do not.
The Columns Panel Variable option enables you to add a variable along the other axis, thus adding another dimension. Adding variables and new dimensions in this way is known as paneling, or faceting.
Whereas paneling involves creating separate graphs for each value of the paneling variable, clustering (gathering data into groups) can be done along the x- or y-axis and the variables you're clustering by are added to the original graph so that either colors or patterns distinguish groups.
Figure 12-8 shows the window that appears when you click the Titles/Footnotes tab in the Chart Builder dialog. Each option in the bottom panel places text at a different location on the graph. When you select an option, the Element Properties tab appears so you can enter the text for the specified location.
You can use the Element Properties tab at any time during the design of a chart to set the properties of individual elements in the chart. For example, we displayed the count in Figure 12-3 but the mean in Figure 12-9. The Element Properties tab changes every time you choose a different member from the list at the top.
Okay, the upcoming list of options is long, but four facts make the options simple to use:
The following is a simple explanation of all possible options that can appear in the Element Properties tab:
Excluded: Any value you want to exclude from the Order list appears in this list. To move a value back to the Order list (which also causes the value to reappear on the chart), select its name and click the arrow to the right of the list.
If a value (or a margin annotation representing a value) is unexpectedly missing from a graph based your selections, look in the Excluded list. You may have excluded too much.
You can edit your chart’s appearance by changing the colors used in the graphs and by controlling grid lines and the display of inner and outer border frames. To make these changes, click the Chart Appearance tab in the Chart Builder dialog to display the Chart Appearance tab, shown in Figure 12-10.
The first section of this tab controls the colors in the graph and their order. You can also specify border and grid line settings.
Templates are files that contain all or part of a chart definition, such as the layouts, fonts, margins, styles, and colors. You can specify which template files you want to use by clicking the Browse button in the Template section and then navigating to and selecting a template. SPSS will apply the template definitions as the default starting points for all charts you build. SPSS comes with various templates, and you can also create a template file from any finished chart displayed in SPSS Statistics Viewer.
Click the Options tab in the Chart Builder dialog to open the Options tab, shown in Figure 12-11. In the Options tab, you specify how you want to handle missing data — that is, when an individual’s response is not available.
If the variables used to define categories or subgroups in your graph have missing values, the Break Variables area allows you to decide whether you want to include or exclude missing categories from your chart.
In the Summary Statistics and Case Values section, the Exclude Listwise for a Consistent Case Basis option includes only cases that have complete data for all variables in a graph, and the Exclude Variable-by-Variable option includes individuals that are missing information on some but not all variables in a graph. (Missing values are discussed in Chapter 4, and the different types of summary data are described in Chapter 14.)
Use the Chart Size option to make the generated charts smaller or larger, as needed. The Wrap Panels option determines how the panels are displayed when you have a number of them in a chart. SPSS is using the word panel to refer to the rectangular area in which a chart is placed in SPSS Statistics Viewer. Normally, panels shrink automatically to fit; if you select this option, they remain full size and wrap to the next line.
The charts you build by choosing Graphs ⇒ Graphboard Template Chooser are similar to those you build by using the other menu selections, but you get less guidance along the way. You also begin in a different way. Here you specify which variables you want to use, and then the menu shows you all the graphing choices that are available for that combination of variables.
Following are the two major reasons for using Graphboard Template Chooser:
The following example takes you through the process of creating a 3-D bar chart, but you can use the same fundamental procedure to build any type of chart:
Choose File ⇒ Open ⇒ Data and load the Bank.sav file.
You have to download the file from www.dummies.com/go/spss4e
.
Make sure the Basic tab is selected.
As with Chart Builder, Graphboard Template Chooser has both a gallery approach (Basic tab) or an elements approach (Detailed tab).
Select the variables you want to include.
To select multiple variables, Ctrl-click. To follow along with the example, select Sex of Employee, Employment Category, and Current Salary.
The displayed graphs change with each selection. Finally, you see several graphs that allow you to display the relationship between two categorical variables and one continuous variable.
In the Summary drop-down menu, choose Mean, as shown in Figure 12-12.
At this point, you're ready to create a 3-D bar chart. Before you do, however, you'll take a brief look at the other tabs in Graphboard Template Chooser.
Click the Detailed tab.
On the Detailed tab, shown in Figure 12-13, you can specify the same information as on the Basic tab. However, on the Basic tab, variable placement is determined by the order in which you select variables. On the Detailed tab, you can specify where you want each variable to go.
Click the Titles tab.
On the Titles tab, you can change or add titles, subtitles, and footnotes for your graph, as shown in Figure 12-14.
Click the Options tab.
The Options tab, shown in Figure 12-15, controls the output label of the graphic, the general style, as well as how missing data will be handled.
Click OK.
The 3-D bar chart shown in Figure 12-16 is generated. It shows employee current salary broken down by gender and employment category.
You can see that males have a higher salary than females across all employment categories. Likewise, there are differences among employment categories; for example, employees in the technical category have a much higher current salary than employees in the clerical category.
3.137.218.215