Time series
When sets of categorical measurements are recorded at successive times, time can be treated as a grouping variable. Stacked barcharts are often informative displays.
Recycling of aluminium cans
The diagram below shows numbers of aluminium beverage cans sold in Australia between 1978 and 1989, and the numbers returned for recycling.
Firstly click the checkbox Stacked. This shows the increase in the total number of aluminium cans sold each year over this period. It also shows the increase in the number of recycled cans.
Now choose Propn within Year from the pop-up menu. The stacked display of these proportions shows how the proportion of cans that were recycled increased.
Binary variables
When the variable of interest can only take two possible values, it is called a binary variable. Examples are
This type of variable is often abstracted by calling the two categories success and failure. Note that either category could be called 'success' with this notation — there is no 'positive' implication associated with the term.
A single binary variable is described fully by the numbers of successes and failures and the proportion of successes is the most useful single summary. Comparison of several groups is based on the proportion of successes in the groups, and these can be displayed in a single bar chart.
Heart disease and snoring
Are snoring and heart disease related? The table below classifies 2,484 subjects by the amount that they snored (reported by their spouses) and whether they had a history of heart disease.
Heart disease | |||
---|---|---|---|
Yes | No | Total | |
Non-snorer | 24 | 1355 | 1479 |
Occasional snorer | 35 | 603 | 638 |
Snores most nights | 21 | 192 | 213 |
Snores every night | 30 | 224 | 254 |
The diagram below shows stacked bar charts for the four groups.
Since the proportions with a history of heart disease are all small, the differences between the groups are not displayed well. Choose Propns for Disease from the pop-up menu to hide the bars for 'No disease' and expand the vertical scale. The resulting diagram looks like a simple bar chart of the proportion with disease in the four groups.
How does the proportion with heart disease vary with the amount of snoring?