liveBook · Manning

Notched boxplot

As explained in Statistics Slam Dunk

A notched boxplot is a boxplot with a narrowed region around the median that visually represents an approximate confidence interval.

A notched boxplot narrows the box around each median to display an approximate confidence interval. Comparing groups becomes easier: non-overlapping notches provide strong evidence that their medians differ. section 14.5.1

p3 <- ggplot(nba_stats, aes(x = o_pts_cat, y = z_wins, fill = o_pts_cat)) +
 geom_boxplot(notch = TRUE, alpha = 0.5) +
 labs(title = "Points Allowed vs. Wins", 
      subtitle = "2008-17",
      x = "Standardized Points Allowed Category", 
      y = "Standardized Regular Season Wins") +
 stat_summary(fun = mean, geom = "point", 
              shape = 20, size = 8, color = "white", fill = "white") + 
 theme(legend.position = "bottom") +
 scale_fill_discrete(name = "Points\nAllowed\nZ-Score", 
                     labels = c("< -1", "-1 to 0", "0 to 1","> 1")) +
 theme(plot.title = element_text(face = "bold"))

Build the chart with ggplot2 by mapping a category to x, standardized wins to y, and setting notch = TRUE in geom_boxplot(). section 14.5.1

NBA scoring and wins

Plot standardized regular-season wins across standardized points-allowed or points-scored categories. Add white mean points with stat_summary(), then compare the notches across categories. section 14.5.1

How Statistics Slam Dunk covers it

How deep it goes
Explains the visual meaning of notches and demonstrates their ggplot2 implementation without deriving the confidence interval.
Examples
Uses NBA points-allowed and points-scored categories plotted against standardized regular-season wins.
What it assumes
Assumes familiarity with boxplots, categorical variables, and ggplot2 mappings.
What you can do after
Apply it via ggplot2 to compare group medians and inspect approximate confidence intervals.
How it connects
Connects boxplots with medians, confidence intervals, means, group comparison, and ggplot2 aesthetics.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.