Defining variables and statistics

Although there is a chart on the canvas, it is not complete because there are no variables or statistics to control how tall the bars are and to specify which variable category corresponds to each bar. You can't have a chart without variables and statistics. You add variables by dragging them from the Variables list, which is located to the left of the canvas.

When you drag the variables, the targets are "drop zones" on the canvas. Some drop zones require a variable while others do not. The drop zone for the x axis is required. The variable in this drop zone controls where the bars appear on the x axis. Depending on the type of chart you are creating, you may also need a variable in the y axis drop zone. For example, when you want to display a summary statistic of another variable (such as mean of salary), you need a variable in the y axis drop zone. Scatterplots also require a variable in the y axis. In that case, the drop zone identifies the dependent variable.

You are going to create a chart that shows bars for the mean income of each job satisfaction category, so both drop zones are needed. There will be a categorical variable on the x axis and a scale variable on the y axis for calculating the mean.

A variable's measurement level is important in the Chart Builder. You are going to use the Job satisfaction variable on the x axis. However, the icon (which looks like a ruler) next to the variable indicates that its measurement level is defined as scale. To create the correct chart, you must use a categorical measurement level. Instead of going back and changing the measurement level in the Variable View, you can change the measurement level temporarily in the Chart Builder.

  1. Right-click Job satisfaction in the Variables list and choose Ordinal. Ordinal is an appropriate measurement level because the categories in Job satisfaction can be ranked by level of satisfaction. Note that the icon changes after you change the measurement level.
  2. Now drag Job satisfaction from the Variables list to the x axis drop zone.

    The y axis drop zone defaults to the Count statistic. If you want to use another statistic (such as percentage or mean), you can easily change it. You will not use either of these statistics in this example, but we will review the process in case you need to change this statistic at another time.

  3. Click the Element Properties tab in the side bar of the Chart Builder. (If the side bar is not displayed, click the button in the upper right corner of the Chart Builder to display the side bar.)
    Figure 1. Element Properties
    Element Properties

    Element Properties allows you to change the properties of the various chart elements. These elements include the graphic elements (such as the bars in the bar chart) and the axes on the chart. Select one of the elements in the Edit Properties of list to change the properties associated with that element. Also note the red X located to the right of the list. This button deletes a graphic element from the canvas. Because Bar1 is selected, the properties shown apply to graphic elements, specifically the bar graphic element.

    The Statistic drop-down list shows the specific statistics that are available. The same statistics are usually available for every chart type. Be aware that some statistics require that the y axis drop zone contains a variable.

  4. Drag Household income in thousands from the Variables list to the y axis drop zone. Because the variable on the y axis is scalar and the x axis variable is categorical (ordinal is a type of categorical measurement level), the y axis drop zone defaults to the Mean statistic. These are the variables and statistics you want, so there is no need to change the element properties.

Next