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.

Body image and race

Does the perception of women about whether they are overweight depend on their ethnic group?

Questionnaires were completed by 246 working women in New Zealand with similar body-mass index (weight in kg divided by the square of height in metres) — all were a little lighter than average for their height. The respondents were classified as Maori (the native population in New Zealand) or of European, Asian or Pacific Islands descent. The diagram below shows each woman's rating of her own size (between slightly underweight and very overweight).

There were different numbers in the different ethnic groups, so select Propn within Ethnic group or Percent within Ethnic 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. Right is between Bit underweight and Bit overweight), the stacked bar charts are particularly effective for comparing the groups. Observe in particular that.