Stacking the bars

Bar charts can be effective for comparing categorical distributions in different groups and we have seen that clustering the bars in different ways can make comparisons easier. An alternative way to reduce the visual separation of the bars that we want to compare is to stack them within each group.

Ordinal categorical variables

Stacked bar charts are particularly effective when the categorical variable is ordinal. An ordinal categorical variable has categories that are ordered — each category is 'between' those on either side in some sense. If the categories cannot be meaningfully ordered, the variable is called a nominal categorical variable.

For example, questionnaires often ask respondents to specify their age by ticking 'Under 20', '20 to 29', '30 to 39', etc. The recorded age is an ordinal categorical variable since each age category is between these on either side. On the other hand, the type of personal computer owned by each respondent (Apple, Hewlett-Packard, Compaq, Dell or Other) is a nominal categorical variable since the categories are not ordered.

Stacked bar charts would be particularly useful for comparing age distributions, but less so for types of computer.

Customer service rating at bank

A major bank has conducted a postal survey to assess customer reactions to the services it provides by mailing a questionnaire to a sample of account holders. One question asked customers to rate overall bank services on a scale between 1 (Excellent) and 5 (Unacceptable). The diagram below shows the distribution of these ratings for different age groups.

There were different numbers of customers in the different age groups, so select Propn within Age group or Percent within Age group from the pop-up menu at the top.

Now click the checkbox Stacked to change the bar chart into a stacked bar chart. Since the responses are ordinal (e.g. Acceptable is between Good and Poor), the stacked bar charts are particularly effective for comparing the groups. Observe in particular that.