← All Data Visualization with AI modules

Module 2 — Descriptive Statistics & Visual Encoding

Weeks 3–4 · graduate statistics · adaptive competencies DV03–DV04

Use center, spread, robust summaries, axes, scales, and labels to make visual structure mathematically honest.

Statistics focusmean, median, IQR, standard deviation, robust summaries, scale and perception
R/tool focusInline browser R labs; optional desktop RStudio/Positron for capstone; dplyr summaries; ggplot2 aesthetics, scales, labels, and transformations
Interactive assignmentRobustness explorer, summary-stat verifier, encoding channel lab, chart repair lab, axis-truncation explorer
DeliverablesVerified summary table with visual justification, before/after chart redesign with a written defence of scale, baseline, and encoding

What students will cover

Module map

Module 2 turns cleaned data into defensible visual choices. Students connect the statistical question to the variable types, then decide whether the audience needs a comparison, distribution, relationship, trend, part-to-whole statement, or uncertainty-aware summary.

Student learning outcomes

By the end of Module 2, students can…
  1. Match statistical questions to appropriate visualization types based on the variables and comparison being made.
  2. Use data type and measurement level to justify chart choice before opening a graphing tool.
  3. Explain how visual encodings communicate information through position, length, color, size, shape, area, angle, and facets.
  4. Compare encoding accuracy and explain why common-axis position and length are usually more precise than area, angle, or decorative color.
  5. Build basic visualizations in browser R using ggplot2 mappings, geoms, scales, labels, and themes.
  6. Revise misleading charts by changing the mark, scale, baseline, denominator, label, or grouping structure.
  7. Critique AI-generated chart recommendations using the original data, statistical question, and visual-encoding principles.
  8. Defend a final visualization in writing with code, interpretation, limitations, and an AI-audit reflection.

Interactive reading

Predict before reveal

A distribution has one extreme high value. Commit to an answer before you open this: which summary better reports the typical value, and — harder — roughly how far can that single point move the mean before anything stops it?

The median. The mean is pulled by extreme values while the median resists them — and the answer to the second half is arbitrarily far. One observation can carry the mean anywhere, which is what it means to say the mean has a breakdown point of zero. You will move that point yourself in the robustness explorer below.

Why distributions matter

From one number to the whole pattern

A distribution is the full pattern of values in a variable — not just its average. It shows where observations cluster, how far they spread, whether the shape is symmetric or skewed, whether there are gaps or multiple peaks, and whether unusual values deserve explanation rather than deletion.

This matters because a single summary can hide the very feature the audience needs to understand. Two classes can have the same mean score but very different spreads; two campuses can have the same median pass rate but different tails; a small group can look extreme because its denominator is unstable. Before students choose a chart, they should ask what the distribution is licensing them to claim.

In the Module 2 capstone, distribution thinking becomes the bridge between statistics and design: histograms and density views reveal shape, boxplots emphasize median and spread, dot plots preserve individual cases for small samples, and summary tables verify whether the visual story is numerically defensible.

Summary statistics lab

Numerical summaries are the structure a chart is built on. Before choosing an encoding, establish which summaries this distribution licenses — and check that the ones you were handed are actually right.

The summary statistics lab needs JavaScript.

Encoding channel lab

Position, length, angle, area, hue, lightness — readers decode these with very different accuracy, and each one carries its own promise about the data. Match the task to the channel it licenses.

The encoding channel lab needs JavaScript.

Chart repair lab

Six flawed charts, each with a tempting fix that leaves the defect in place. Diagnose before you repair — the obvious correction is often the wrong one.

The chart repair lab needs JavaScript.

AI-output audit

This AI audit needs JavaScript.

Hands-on visual lab

One design decision, six real pass rates, and a ratio that comes apart from the data. Move the baseline and watch how far a reader can be misled without a single incorrect label. Then run the browser-R lab below without leaving QuantegyAI.

This visual lab needs JavaScript.

GeoGebra lab

Use GeoGebra to make scale, proportion, and visual distortion visible. The AI can draft construction commands, but you must verify the visual claim against the data.

Interactive Math with AI / GeoGebra strand

Embedded GeoGebra applet loading…

R lab

R / Quarto / Shiny workflow

Compute mean, median, SD, and IQR; build multiple ggplot2 views of the same data; then write a Chart Choice Defense explaining why one visualization answers the question more honestly than another.

# Suggested R workflow scaffold
library(ggplot2)

scores <- data.frame(
  campus = c("North", "South", "East", "West", "Central", "Online"),
  pass_rate = c(0.92, 0.94, 0.95, 0.96, 0.93, 0.95),
  tested = c(84, 122, 76, 98, 111, 64)
)

# 1. Verify summaries before visualizing
summary(scores$pass_rate)
cat("Mean pass rate:", round(mean(scores$pass_rate), 3), "\n")
cat("Median pass rate:", round(median(scores$pass_rate), 3), "\n")
cat("Range:", paste(range(scores$pass_rate), collapse = " to "), "\n")

# 2. Build a bar chart only if the baseline is honest
p_bar <- ggplot(scores, aes(x = reorder(campus, pass_rate), y = pass_rate)) +
  geom_col() +
  coord_flip() +
  scale_y_continuous(limits = c(0, 1)) +
  labs(title = "Full-baseline bar chart", x = "Campus", y = "Pass rate")

# 3. Build a dot plot for close comparisons in a narrow range
p_dot <- ggplot(scores, aes(x = pass_rate, y = reorder(campus, pass_rate))) +
  geom_point(size = 3) +
  scale_x_continuous(limits = c(0.90, 0.97)) +
  labs(title = "Dot plot for close pass-rate comparisons", x = "Pass rate", y = "Campus")

print(p_bar)
print(p_dot)

# 4. Chart Choice Defense:
# Which chart answers the question better, and what claim would be misleading?

Module 2 Capstone

The inline Module 2 capstone submission and AI grader need JavaScript.

Adaptive reflection

What I know / where I go next

Mastery check loading…

Capstone connection Add this module’s evidence to your capstone readiness tracker. If your explanation depends on AI, include the prompt, output, verification method, and final correction.