Variables and Chart Types

The Variables tab allows you to change the structure of your chart. You can use the tab to convert the underlying graphic element and to redefine the roles of the variables in chart. Specific examples of these changes include:

  • Converting from one chart type to another (for example, converting a bar chart to a line chart or a scatterplot matrix to a 3-D scatterplot).
  • Moving a variable to a different axis.
  • Changing the clustering or stacking variable.
  • Changing the grouping variable.
  • Changing the paneling variable.

Examples of Using the Variables Tab provides steps that illustrate some of these examples.

Except for converting the chart type, changes using the Variables tab involve the variable roles. Changing the variable role alters the way in which the Chart Editor calculates statistics. It is not a simple change in the way the chart looks. For example, the fit line calculation is different if you redefine which variable is the x-axis (independent) variable and which is the y-axis (dependent) variable. If you want to show only the variables on different axes, transpose the chart instead. Transposing is like swapping the chart axes. See the topic Transposing a Chart for more information.

Using the Variables Tab

The following descriptions use the term variable for actual variables in the data and for measurement variables (such as count or percentage) that are calculated when the chart is created.

Element Type. Specify the graphic element type. Depending on the underlying structure of the chart, some graphic element types may not be available. When you change the element type, the Chart Editor automatically changes the roles of the variables in the chart, if necessary. For example, if you are converting a clustered bar chart to a pie chart, clustering doesn't make sense for the pie chart. Therefore, the Chart Editor will use the clustering variable for paneling instead.

Variables Grid. The variables grid appears below the Element Type drop-down list. It allows you to change the roles of the variables in the chart. The variable role defines how a variable is used in the chart. For example, you can change a paneling variable into a clustering variable. Or you can move a variable to another axis. In addition to assigning a role for a variable, you can identify the style that is associated with the role, such as whether color or pattern is used for the clustering variable.

The first column in the variables grid identifies the available variables, sorted in alphabetical order. Some available variables may not be in displayed the chart. For each variable, you can assign a role. Click the other cell in the same row as the variable name to reveal a drop-down list that shows the available roles for the variable. If you assign a role that is already assigned to another variable, the Chart Editor swaps the roles of the two variables. You can also choose the first option, Exclude, to exclude the variable from the chart. Excluding a variable isn't always possible, depending on whether the variable is needed to preserve the validity of an underlying statistic.

If you choose a role other than the axis and paneling roles, you can assign an applicable style to the role (such as color for the clustering variable) by clicking the cell directly below the cell that defines the role. Styles appear at the end of the list, but they are not available before choosing a role. You don't have to choose a style. If you don't choose a style, the Chart Editor picks an appropriate default when you click Apply. You can change the variable role style at any time. You can assign multiple styles to the same role (like pattern and color for the grouping variable). Click the next available cell for the variable and choose a style from the list.

Element. Below the variables grid is a group of controls for creating and navigating multiple graphic elements. For example, if you have a chart with markers (points) and lines, you can use these controls to switch between the graphic elements and assign roles to the variables for each element. Overlay scatterplots are always multiple element charts. Another common example is a scatterplot with a fit line. The markers are one element, and the fit line is another. Grouped charts (like a grouped scatterplot), on the other hand, are not multiple element charts. A multiple element chart typically has different variables or statistics assigned to the elements.

To add an element to a chart, click New and then use the variables grid to assign roles to the variables associated with the element. You can navigate the graphic elements in the chart by clicking Next and Previous.