Example: City and Highway Mileage by Origin

For example, you can create a bar-line chart that compares the number of miles per gallon (in the city and on the highway) that cars use depending on their country of origin. The task calculates the mean of the number of miles per gallon in the city and in the highway for each country. This bar-line chart shows that cars from Asia tend to get the highest number of miles per gallon in city and highway driving.
To create this example:
  1. In the Tasks section, expand the Graph folder, and then double-click Bar-Line Chart. The user interface for the Bar-Line Chart task opens.
  2. On the Data tab, select the SASHELP.CARS data set.
    Tip
    If the data set is not available from the drop-down list, click Select a table icon. In the Choose a Table window, expand the library that contains the data set that you want to use. Select the data set for the example and click OK. The selected data set should now appear in the drop-down list.
  3. Assign columns to these roles:
    Role
    Column Name
    Category variable
    Origin
    Bar response variable
    MPG_City
    Line response variable
    MPG_Highway
  4. To run the task, click Submit SAS Code.
Bar-Line Chart of City and Highway Mileage by Origin