Example: Create a Line Plot from a Group Variable

The following steps use the same data set as the previous example, but this time plot the co variable over a 24-hour period for each day of the week.

  1. In the data table, right-click the day variable, and select Nominal from the pop-up menu, as shown in Figure 6.16.

    Figure 6.16: Changing the Role of a Variable

    Nominal variables can be used as group variables in the construction of a line plot.

  2. Press the ESC key to deselect the day variable.

  3. Select GraphLine Plot from the main menu.

    The Line Plot dialog box appears. (See Figure 6.17.)

  4. Select the variable co, and click Add Y.

  5. Select the variable hour, and click Set X.

  6. Select the variable day, and click Add Group.

  7. Click OK.

    Figure 6.17: Specifying a Group Variable

    The line plot that appears (Figure 6.18) has seven lines, one for each day of the week. For several days early in the week, the daily carbon monoxide peaked during the commuting times in the morning and evening: roughly 8 a.m. and 6–7 p.m.

    Figure 6.18: A Line Plot with a Group Variable

    To better visualize each day’s carbon dioxide, you can use a bar chart to select each day individually.

  8. Select GraphBar Chart from the main menu.

    The Bar Chart dialog box appears.

  9. Select the day variable, and click Set X.

  10. Click OK.

    The resulting plots are shown in Figure 6.19.

    You can now select each day of the week and examine the observations for that day.

Figure 6.19: Exploring Data for Each Day