liveBook · Manning

Winsorization

As explained in Statistics Slam Dunk

Winsorization is a data-treatment technique that replaces extreme observations with less extreme boundary values rather than removing them.

Winsorization treats extreme observations by replacing them with boundary values instead of deleting them. This preserves the dataset’s length while reducing the influence that outliers can exert on regression results. section 5.4 section 20.4

A practical winsorization workflow is:

  • Inspect distributions with scatterplots, histograms, and boxplots; use boxplots to make outlier identification and boundary selection less subjective. section 5.4.1
  • Replace values beyond a boxplot whisker with the whisker endpoint rather than removing observations. section 5.4.1
  • Check the revised distribution and confirm the new extreme value with a summary statistic. section 5.4.1

Capping extreme deflections

The hustle dataset contained two unusually high deflections, with an original maximum of 18.70. Replacing every value above 17.8 with 17.8 preserved all 90 rows, changed the maximum to 17.8, and produced a boxplot without outliers. section 5.4.1

sp1 <- qplot(seq_along(hustle$deflections), hustle$deflections) +
 labs(title = "Deflections", 
      subtitle = "scatterplot", 
      x = "", 
      y = "Value") +
 theme(plot.title = element_text(face = "bold")) +
 annotate("text", x = 65, y = 18.5, 
          label = "Outlier?", color = "red",
          size = 3, fontface = "bold") +
 annotate("text", x = 85, y = 18.3, 
          label = "Outlier?", color = "red",
          size = 3, fontface = "bold") 

hist1 <- ggplot(hustle, aes(x = deflections)) + 
 geom_histogram(fill = "snow1", color = "dodgerblue4", bins = 8) + 
 labs(title  ="Deflections", 
      subtitle = "histogram",
      x = "",           
      y  = "Frequency") +
 theme(plot.title = element_text(face = "bold")) +
 annotate("text", x = 18.75, y = 3, 
          label = "  Outliers?", color = "red",
          size = 3, fontface = "bold") 

bp1 <- ggplot(hustle, aes(x = "", y = deflections)) + 
 labs(title = "Deflections", 
      subtitle = "boxplot", 
      x = "", 
      y = "") +
 geom_boxplot(color = "dodgerblue4", fill = "snow1", width = 0.5) +
 stat_summary(fun = mean, geom = "point", shape = 20, size = 8,
              color = "dodgerblue4", fill = "dodgerblue4") + 
 annotate("text", x = "", y = 18.6, 
          label = "                  Outliers",
          color = "red", size = 3, fontface = "bold") +
 theme(plot.title = element_text(face = "bold"))

Compare the scatterplot, histogram, and boxplot used to locate extreme deflections before capping them. section 5.4.1

How Statistics Slam Dunk covers it

How deep it goes
Explains visual detection, whisker-based replacement, verification, and post-treatment plotting, but does not develop alternative statistical capping methods.
Examples
Demonstrates capping two extreme deflections at 17.8 in a 90-row NBA hustle dataset.
What it assumes
Assumes basic familiarity with distributions, boxplots, outliers, and regression, while defining winsorization through a concrete example.
What you can do after
Apply winsorization in base R by replacing values above a chosen boundary and checking the revised maximum and boxplot.
How it connects
Connects winsorization to outliers, boxplots, histograms, scatterplots, data wrangling, and linear regression.

Also explained in

Compare how 2 books explain winsorization →

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.