01 / 21

Choosing
Plots

Learn when to use a histogram, boxplot, or bar chart to display biostatistical data clearly and accurately.

Biostatistics

Why Visualization Matters

Raw data tables are hard to interpret. A well-chosen plot reveals patterns, outliers, and distributions that summary statistics alone can hide. In biostatistics, the wrong plot can mislead clinicians and researchers.

Two Kinds of Data

Categorical
Data that falls into groups or labels: blood type, treatment group, disease status. You count how many observations are in each category.
Numerical
Data measured on a continuous or discrete scale: blood pressure (mmHg), age (years), cell count. You care about the distribution of values.

Meet the Three Plots

Histogram
Shows the distribution of one numerical variable by grouping values into bins.
Boxplot
Summarizes a numerical variable with median, quartiles, and outliers. Great for comparing groups.
Bar Chart
Displays counts or proportions for each category of a categorical variable.

The Histogram: Shape of Data

100 110 120 130 140 150 160 Systolic BP (mmHg) Frequency 0 10 20

The Boxplot: Five-Number Summary

Lower Whisker \(Q_1\) Median \(Q_3\) Upper Whisker Outlier 100 115 128 140 155 180 Systolic BP (mmHg) IQR

The Bar Chart: Counting Categories

42 30 20 8 Type O Type A Type B Type AB Blood Type Count

The Decision Rule

What type of variable? Categorical Bar Chart Numerical Show distribution? Histogram Compare groups? Boxplot

Histogram vs. Bar Chart

Histogram Bar Chart
Data type Numerical (continuous) Categorical
Bars Touch (no gaps) Separated by gaps
X-axis Value ranges (bins) Category labels
Bar order Fixed by numeric scale Can be rearranged
Shows Distribution shape Counts per category

When to Use Each Plot

Histogram
Exploring the shape of a single numerical variable: is it symmetric, skewed, bimodal? Best for \(n > 20\).
Boxplot
Comparing a numerical variable across two or more groups side by side. Highlights medians and outliers efficiently.
Bar Chart
Displaying frequencies or proportions of a categorical variable: disease status, treatment arm, genotype.

Step-by-Step Checklist

1
Identify the variable type. Is it categorical (labels) or numerical (measurements)?
2
Determine your goal. Do you want to see distribution shape, compare groups, or count categories?
3
Match plot to goal. Distribution shape: histogram. Group comparison: boxplot. Category counts: bar chart.
4
Check sample size. Histograms need \(n \geq 20\) to reveal meaningful shapes. Small samples suit boxplots or dotplots.
5
Label clearly. Add axis titles, units, and a descriptive title so the plot stands on its own.

Example 1: Patient Ages

A clinical trial enrolls 150 participants. You record each patient's age in years and want to see how ages are distributed across the sample.

20 30 40 50 60 70 80 Age (years) Right-skewed

Example 2: Comparing Drug Groups

A study compares cholesterol levels (mg/dL) across three treatment arms: Placebo, Drug A, and Drug B. You want to compare centers and spreads.

160 180 200 220 240 Placebo Drug A Drug B Cholesterol (mg/dL)

Example 3: Infection Types

A hospital records the type of infection diagnosed in 200 patients during one month: respiratory, urinary, skin, and gastrointestinal. You want to compare how common each type is.

75 55 42 28 Respiratory Urinary Skin GI Infection Type

Common Mistakes

✕ Histogram for Categories
Using a histogram to plot categorical data (e.g., blood type). Categories are not continuous: bins make no sense.
✕ Bar Chart for Distributions
Using a bar chart for continuous data. Gaps between bars falsely imply the data is discrete when it is not.
✕ Ignoring Outliers
Choosing a histogram when outlier detection matters. Boxplots explicitly flag outliers; histograms bury them in bins.

Summary Comparison

Histogram Boxplot Bar Chart
Variable Numerical Numerical Categorical
Shows Distribution shape Median, IQR, outliers Counts / proportions
Best for One variable, \(n > 20\) Comparing \(\ge 2\) groups Category frequencies
Bars touch? Yes N/A No (gaps)
Outlier detection Indirect Explicit N/A

Question 1 of 5

A researcher records the weight (kg) of 80 newborns and wants to see if the data is normally distributed. Which plot should she use?

Question 2 of 5

A hospital wants to compare length of stay (days) between the ICU, surgical ward, and general ward. Which plot is most appropriate?

Question 3 of 5

Which of the following is a key visual difference between a histogram and a bar chart?

Question 4 of 5

A survey asks 500 people which COVID-19 vaccine brand they received (Pfizer, Moderna, J&J, or AstraZeneca). You want to show the proportion receiving each. What plot do you choose?

Question 5 of 5

A dataset of fasting glucose (mg/dL) contains one extreme value of 450 mg/dL among 60 patients. Which plot best highlights this outlier?