Example: Stacked Bar Chart with a Summary Statistic

We will now create a stacked bar chart to see whether the difference in mean salary between males and females is subject to job type. Perhaps females, on average, make more than males for certain job types.

Note: This example uses Employee data.
  1. Add a Graphboard node and open it for editing.
  2. On the Basic tab, select Employment Category and Current Salary . (Use Ctrl+Click to select multiple fields/variables.)
  3. Select Bar.
  4. From the Summary list, select Mean.
  5. Click the Detailed tab. Note that your selections from the previous tab are reflected here.
  6. In the Optional Aesthetics group, choose gender from the Color drop-down list.
  7. Click Run.
Figure 1. Stacked bar chart
Stacked bar chart

We can observe the following:

  • The difference in mean salaries for each job type does not appear to be as great as it was in the bar chart that compared the mean salaries for all males and females. Perhaps there are varying number of males and females in each group. You could check this by creating a bar chart of counts.
  • Regardless of job type, the mean salary for males is always greater than the mean salary for females.