Describing Behavior with Visualizations: Categorical and Continuous Data
Categorical Data Visualisations: Pie Charts and Bar Graphs
Visualising data provides a pictorial representation of behaviour alongside numerical data.
Data is split into two primary types for visualisation: categorical and continuous.
Pie Charts
Definition: A pie chart is a circular graphic used to visualise categorical data. The circle (the pie) is divided into slices (areas), where the area of each slice is proportional to the percentage or count of observations in that category.
Example Case Study: In a fictitious study of people regarding their favourite season:
Categories: Spring, Summer, Winter, and Autumn.
Observation: The majority of participants favoured autumn, which was represented by the largest slice in the pie chart.
Legend: Used to distinguish categories via colour-coding.
Advantages: They provide an excellent visual summary that can be interpreted quickly and easily for simple datasets.
Pitfalls and Limitations:
Category Limit: Pie charts become confusing and difficult to read if there are too many categories. It is recommended to avoid using them if there are more than categories.
Shakespeare Example: A pie chart of causes of death in Shakespearean plays shows stabbing accounts for more than of deaths. However, because there are many minor categories, it is difficult to distinguish the proportions of the smaller slices.
Small Percentages: When percentages are tiny, they are visually indistinguishable. For instance, a 2007 Wikipedia graph of the US federal budget shows that while large categories are clear, smaller spending areas are nearly impossible to differentiate.
Optimal Use: Best used for a small number of categories with relatively large percentage differences.
Bar Charts
Structure:
X-axis (Horizontal): Represents the categories (e.g., Spring, Summer, Winter, Autumn).
Y-axis (Vertical): Represents the frequency (count) or a summary statistic.
Function: Users compare the height of the bars to determine differences across categories.
Types of Y-axis Values:
Raw Values: Simple counts or votes (e.g., how many people voted for each season).
Summary Statistics: Values describing the overall behaviour of a group, such as the mean () or median.
Athletic Performance Example:
Study involving athletes per group across categories: Bowling, Athletics, Swimming, Hockey, and Football.
The Y-axis represents the mean race time () for a sprint.
Results: Bowling athletes had a mean race time of approximately , while athletics athletes had a much faster mean time of approximately .
Error Bars: Used with summary statistics to indicate variability. Common error bars represent plus or minus one standard deviation () around the mean.
Comparing Multiple Variables & Interactions:
Bar charts can compare data across two variables (e.g., athlete type vs. country of origin).
Trends: Comparisons can show consistent patterns (e.g., hockey players being faster than bowlers in both Country A and Country B).
Interactions: An interaction occurs when the effect of one variable depends on the level of another.
Interaction Example: Bowling athletes from Country A are slower than those from Country B, but swimming athletes from Country A are faster than those from Country B.
Bar Chart Pitfalls:
Like pie charts, they become cluttered with too many categories or when counts differ dramatically (e.g., Shakespeare death data where stabbing dwarfs all other categories).
Scaling Issues (Truncated Axis): The Y-axis scale can be manipulated to exaggerate differences.
Fox News Example: An infographic showed the number of people on welfare ( million) versus people with full-time jobs ( million). By starting the Y-axis at million rather than , the difference appeared massive. When replotted starting at , the difference is visually much smaller.
Continuous Data Visualisations: Stem and Leaf Plots
Purpose: Like histograms, they show frequency distributions for continuous data but retain more numerical detail.
Composition:
Stem: Includes everything but the last digit of the number.
Leaf: The final digit of the number.
Construction Process (Using IQ scores: ):
1. Draw a vertical line to separate the stem and leaf.
2. List the stems in ascending order in the left column: .
3. Add the corresponding leaves to the right:
| (representing )
| (representing )
| (representing and )
| (representing )
Visual Interpretation: If rotated degrees to the right, the leaves form a shape identical to a histogram.
Stem and Leaf vs. Histogram:
Stem and Leaf: Provides more numerical detail (individual scores are visible).
Histogram: Offers more visual impact and makes identifying shape and spread easier.
Continuous Data Visualisations: Box Plots
Components: Box plots (or box-and-whisker plots) use five key summary statistics:
Median (): The middle value separating the data into two halves.
Quartile 1 (): The 25th percentile (middle of the lower half).
Quartile 3 (): The 75th percentile (middle of the upper half).
Interquartile Range (): Calculated as . It represents the middle of the data.
1.5 IQR Rule: Used to identify potential outliers.
Example Case Study (Memory Test Data, ):
Median: ( participants above, below).
; .
.
Outlier Thresholds:
Upper cut-off = .
Lower cut-off = .
Results: Scores below or above are outliers. In this set, scores of and (an error) were identified.
Visual Anatomy of a Box Plot:
Box: Bottom is , top is . The vertical height is the .
Line inside box: Represents the Median ().
Whiskers: Lines extending to the largest and smallest values that fall within the calculated cut-offs.
Circles/Dots: Individual points representing potential outliers beyond the whiskers.
Identifying Skewness:
Positive Skew: The median line is positioned closer to the bottom of the box; the upper whisker is often longer.
Negative Skew: The median line is positioned closer to the top of the box; the lower whisker is often longer.
Comparing Multiple Box Plots: Useful for comparing distributions across categories (e.g., Movie genre vs. Critic ratings).
Families/Music movies: Lower median ratings.
Fantasy/Mystery: Negatively skewed distributions.
Biography: Contains several low-rating outliers.
Principles for Describing Data
The Simplicity Principle: Keep graphs clean and simple. Avoid excessive textures, 3D effects, or orientations that distract from the data (inappropriate vs. appropriate graphs).
Pictures vs. Numbers:
Use Pictures (Histograms and Box Plots) to evaluate data shape: Normality, skewness, kurtosis, and modality (number of peaks).
Use Numbers (Mean, Median, Mode, SD, ) to define the centre and spread.
Use Both to identify outliers (e.g., using the rule or the to Standard Deviation rule alongside visual inspection).
Selection Flowchart:
1. Is the distribution badly skewed?
Yes: Support with Median, , and Box Plot.
2. Are there major outliers?
Yes: Support with Median, , and Box Plot.
3. If no major skew or outliers:
Use Mean, Standard Deviation, and Histogram.
Modality: Histograms are superior to box plots for identifying if a distribution is unimodal, bimodal, or multimodal.
Summary of Visualisation Tools
Pie Charts: Proportional categorical data (best for <10 categories).
Bar Charts: Categorical counts or summary statistics (means/medians).
Stem and Leaf Plots: Continuous frequency data with numerical detail.
Histograms: Continuous frequency data with visual impact for shape/spread.
Box Plots: Continuous data distribution using quartiles, medians, and outlier detection.