Exploring Data in Two Dimensions |
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.
In the data table, right-click the day variable, and select Nominal from the pop-up menu, as shown in Figure 6.16.
Nominal variables can be used as group variables in the construction of a line plot.
Press the ESC key to deselect the day variable.
Select Graph Line Plot from the main menu.
The Line Plot dialog box appears. (See Figure 6.17.)
Select the variable co, and click Add Y.
Select the variable hour, and click Set X.
Select the variable day, and click Add Group.
Click OK.
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.
To better visualize each day’s carbon dioxide, you can use a bar chart to select each day individually.
Select Graph Bar Chart from the main menu.
The Bar Chart dialog box appears.
Select the day variable, and click Set X.
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.
Copyright © SAS Institute, Inc. All Rights Reserved.