Descriptive Statistics: Outliers and Boxplots

Learning Objectives & Overview of Descriptive Statistics

  • Descriptive statistics involves summarizing and describing quantitative data using four central concepts:

    • Center: Describes the middle or most typical value of a dataset.

    • Variation: Describes the spread or extent to which data points vary.

    • Distribution: Describes the shape and pattern of data values.

    • Outliers: Identifies highly unusual observations that lie far outside the range of typical data.

  • Quantitative data can be comprehensively summarized and visualized using quartiles, fences, and boxplots.

The 5-Number Summary

  • Definition: The 5-number summary of a quantitative data set provides a concise description of its spread and center. It consists of:

    • Minimum value (Min\text{Min})

    • First quartile (Q1Q_1)

    • Second quartile or Median (Q2=MQ_2 = M

    • Third quartile (Q3Q_3)

    • Maximum value (Max\text{Max})

  • Notation: The 5-number summary is written in sequential order as: Min,Q1,Median=Q2,Q3,Max\text{Min}, Q_1, \text{Median} = Q_2, Q_3, \text{Max}.

  • Example 1: Finding the 5-number Summary for Quiz Scores

    • Dataset (n=11n = 11): 8,5,7,5,9,4,9,4,10,3,98, 5, 7, 5, 9, 4, 9, 4, 10, 3, 9

    • Step 1: Arrange data in ascending order:     3,4,4,5,5,7,8,9,9,9,103, 4, 4, 5, 5, 7, 8, 9, 9, 9, 10

    • Step 2: Identify summary statistics:

    • Minimum: Min=3\text{Min} = 3

    • First quartile: Q1=4Q_1 = 4

    • Second quartile (Median): Q2=7Q_2 = 7

    • Third quartile: Q3=9Q_3 = 9

    • Maximum: Max=10\text{Max} = 10

    • 5-number summary: 3,4,7,9,103, 4, 7, 9, 10

    • StatCrunch Procedure: Select Stat →\rightarrow Summary Stats →\rightarrow Columns, choose the column variable, and click Compute!.

  • Example 2: Finding the 5-number Summary from Poverty Rate Data

    • Dataset (n=51n = 51): Average poverty rates for all 50 US states and the District of Columbia (2016–2018).

    • Complete Data Values:

    • Alabama: 16.016.0

    • Alaska: 12.212.2

    • Arizona: 14.414.4

    • Arkansas: 15.515.5

    • California: 12.512.5

    • Colorado: 8.98.9

    • Connecticut: 9.99.9

    • Delaware: 9.69.6

    • District of Columbia: 14.914.9

    • Florida: 13.613.6

    • Georgia: 14.714.7

    • Hawaii: 9.59.5

    • Idaho: 11.311.3

    • Illinois: 10.910.9

    • Indiana: 11.811.8

    • Iowa: 9.29.2

    • Kansas: 10.810.8

    • Kentucky: 15.315.3

    • Louisiana: 19.819.8

    • Maine: 12.612.6

    • Maryland: 7.17.1

    • Massachusetts: 9.89.8

    • Michigan: 11.011.0

    • Minnesota: 8.78.7

    • Mississippi: 19.819.8

    • Missouri: 11.911.9

    • Montana: 10.410.4

    • Nebraska: 10.410.4

    • Nevada: 12.212.2

    • New Hampshire: 6.46.4

    • New Jersey: 9.19.1

    • New Mexico: 18.718.7

    • New York: 11.811.8

    • North Carolina: 14.114.1

    • North Dakota: 10.910.9

    • Ohio: 12.812.8

    • Oklahoma: 14.014.0

    • Oregon: 10.610.6

    • Pennsylvania: 11.511.5

    • Rhode Island: 10.310.3

    • South Carolina: 14.114.1

    • South Dakota: 11.811.8

    • Tennessee: 12.612.6

    • Texas: 13.713.7

    • Utah: 7.97.9

    • Vermont: 9.69.6

    • Virginia: 10.710.7

    • Washington: 10.310.3

    • West Virginia: 17.217.2

    • Wisconsin: 9.59.5

    • Wyoming: 11.411.4

    • Summary Statistics Output:

    • Min=6.4\text{Min} = 6.4

    • Q1=9.9Q_1 = 9.9

    • Q2=11.5Q_2 = 11.5

    • Q3=14Q_3 = 14

    • Max=19.8\text{Max} = 19.8

    • Practical Interpretation:

    • Approximately 25%25\% of states have average poverty rates between 6.4%6.4\% and 9.9%9.9\%.

    • Approximately 25%25\% of states have average poverty rates between 9.9%9.9\% and 11.5%11.5\%.

    • Approximately 25%25\% of states have average poverty rates between 11.5%11.5\% and 14%14\%.

    • Approximately 25%25\% of states have average poverty rates between 14%14\% and 19.8%19.8\%.

Boxplots without Outliers

  • Definition: A boxplot (also referred to as a "whisker plot") is a visual diagram constructed from the 5-number summary. It displays the quartiles, interquartile range (IQRIQR), and total range of a dataset.

Format for a boxplot
  • Anatomical Components of a Standard Boxplot:

    • Middle Box: Represents the middle 50%50\% of the dataset. The left edge is drawn at Q1Q_1, and the right edge is drawn at Q3Q_3. The width of the box corresponds exactly to the Interquartile Range (IQR=Q3−Q1IQR = Q_3 - Q_1).

    • Median Line: A vertical line segment drawn inside the box at Q2Q_2

    • Whiskers: Horizontal line segments extending from the box edges:

    • Left whisker: Extends from Min\text{Min} to Q1Q_1.

    • Right whisker: Extends from Q3Q_3 to Max\text{Max}.

    • Percentile Breakdown: Each section (left whisker, left box side, right box side, right whisker) represents roughly 25%25\% of the data observations.

  • Step-by-Step Procedure to Construct a Boxplot by Hand:

    • Step 1: Draw a horizontal axis scaled with equal spacing long enough to contain the minimum and maximum data values. Draw vertical line segments above the axis at Q1Q_1, Q2Q_2, and Q3Q_3.

    • Step 2: Draw horizontal line segments connecting the tops and bottoms of the vertical segments at Q1Q_1 and Q3Q_3 to form the middle box.

    • Step 3: Place a point/dot at the minimum value and at the maximum value.

    • Step 4: Draw whisker line segments from Q1Q_1 to Min\text{Min} and from Q3Q_3 to Max\text{Max}.

  • Critical Rule for Axis Scaling:

    • When drawing a boxplot, tick marks on the horizontal axis must be labeled using equally spaced increments. Incorrect or non-uniform spacing results in a visually distorted and misleading boxplot.

  • Example 3: Hand Construction using Poverty Rate Data

    • Given 5-number summary: Min=6.4\text{Min} = 6.4, Q1=9.9Q_1 = 9.9, Q2=11.5Q_2 = 11.5, Q3=14Q_3 = 14, Max=19.8\text{Max} = 19.8

    • Axis marked evenly from 44 to 2020

    • Vertical lines at 9.99.9, 11.511.5, and 14.014.0

    • Box formed between 9.99.9 and 14.014.0

    • Dots at 6.46.4 and 19.819.8

    • Whiskers extending from 9.99.9 down to 6.46.4 and from 14.014.0 up to 19.819.8

  • StatCrunch Procedure for Making Boxplots:

    1. Input data into a column in StatCrunch.

    2. Select Graph →\rightarrow Boxplot.

    3. Select the desired column variable name.

    4. Check the option Draw boxes horizontally.

    5. Click Compute!.

Identifying Outliers using Fences

  • Definition of Outlier: An outlier is an observation that lies far outside the normal range of values for a data set.

  • Mathematical Definition of Fences:

    • Fences serve as statistical boundaries to identify potential outliers.

The fences of a data set
  • Left Fence (Lower Fence): LF=Q1−1.5×IQRLF = Q_1 - 1.5 \times IQR

  • Right Fence (Upper Fence): RF=Q3+1.5×IQRRF = Q_3 + 1.5 \times IQR

  • Interquartile Range formula: IQR=Q3−Q1IQR = Q_3 - Q_1

    • Outlier Criterion:

  • Observations falling between the fences (LF≤x≤RFLF \le x \le RF) are considered typical data values.

  • Observations falling outside the fences (x<LFx < LF or x>RFx > RF) are defined as outliers.

Outliers marked outside fences
  • Procedure to Identify Outliers in a Dataset:

    1. Determine quartiles Q1Q_1, Q2Q_2 (Median), and Q3Q_3

    2. Compute the Interquartile Range: IQR=Q3−Q1IQR = Q_3 - Q_1

    3. Calculate the boundaries:      LF=Q1−1.5×IQRLF = Q_1 - 1.5 \times IQR      RF=Q3+1.5×IQRRF = Q_3 + 1.5 \times IQR

    4. Compare all data values to LFLF and RFRF. Any value strictly less than LFLF or strictly greater than RFRF is classified as an outlier.

  • Order of Operations Tip:

    • When calculating fences, always execute multiplication before addition or subtraction:

    • Multiply 1.5×IQR1.5 \times IQR first.

    • Subtract that product from Q1Q_1 for LF\text{LF}.

    • Add that product to Q3Q_3 for RF\text{RF}.

  • Example 5: Checking Poverty Rates for Outliers

    • Summary Stats: n=51n = 51, Q1=9.9Q_1 = 9.9, Q3=14.0Q_3 = 14.0, Min=6.4\text{Min} = 6.4, Max=19.8\text{Max} = 19.8

    • Calculations:     IQR=14.0−9.9=4.1IQR = 14.0 - 9.9 = 4.1     LF=9.9−(1.5×4.1)=9.9−6.15=3.75LF = 9.9 - (1.5 \times 4.1) = 9.9 - 6.15 = 3.75     RF=14.0+(1.5×4.1)=14.0+6.15=20.15RF = 14.0 + (1.5 \times 4.1) = 14.0 + 6.15 = 20.15

    • Comparison:

    • Lowest data value is 6.4≥3.756.4 \ge 3.75

    • Highest data value is 19.8≤20.1519.8 \le 20.15

    • Conclusion: All values fall strictly between 3.753.75 and 20.1520.15. Therefore, there are no outliers in the poverty rate data set.

  • Example 6: Checking Presidential Inauguration Ages for Outliers

    • Dataset (n=46n = 46): Ages of US Presidents at inauguration.

    • Data Values: 57,68,56,54,60,64,61,51,46,42,61,46,57,49,54,51,43,54,57,64,49,56,55,47,58,50,51,55,56,70,57,48,47,51,61,78,61,65,55,54,52,54,52,55,51,6957, 68, 56, 54, 60, 64, 61, 51, 46, 42, 61, 46, 57, 49, 54, 51, 43, 54, 57, 64, 49, 56, 55, 47, 58, 50, 51, 55, 56, 70, 57, 48, 47, 51, 61, 78, 61, 65, 55, 54, 52, 54, 52, 55, 51, 69

    • Summary Output:

    • n=46n = 46

    • Mean=55.478261\text{Mean} = 55.478261

    • Variance=53.766184\text{Variance} = 53.766184

    • Std. dev.=7.3325428\text{Std. dev.} = 7.3325428

    • Std. err.=1.0811245\text{Std. err.} = 1.0811245

    • Median=55\text{Median} = 55

    • Range=36\text{Range} = 36

    • Min=42\text{Min} = 42

    • Max=78\text{Max} = 78

    • Q1=51Q_1 = 51

    • Q3=60Q_3 = 60

    • Outlier Calculations:     IQR=Q3−Q1=60−51=9IQR = Q_3 - Q_1 = 60 - 51 = 9     LF=51−(1.5×9)=51−13.5=37.5LF = 51 - (1.5 \times 9) = 51 - 13.5 = 37.5     RF=60+(1.5×9)=60+13.5=73.5RF = 60 + (1.5 \times 9) = 60 + 13.5 = 73.5

    • Evaluation:

    • Min=42≥37.5\text{Min} = 42 \ge 37.5

    • Max=78>73.5\text{Max} = 78 > 73.5

    • Conclusion: The age 7878 is greater than the upper fence (73.573.5). Thus, 7878 is identified as an outlier.

Modified Boxplots (Boxplots with Outliers)

  • Definition: A modified boxplot explicitly denotes outliers rather than extending whiskers out to the extreme values.

  • Key Visual Indicator: A dot or asterisk displayed on a modified boxplot represents an individual outlier.

Boxplot displaying ages of presidents at inauguration with outlier
  • Procedure to Create a Modified Boxplot:

    1. Find quartiles Q1Q_1, Q2Q_2 (Median), and Q3Q_3

    2. Compute IQR=Q3−Q1IQR = Q_3 - Q_1

    3. Compute fences: LF=Q1−1.5×IQRLF = Q_1 - 1.5 \times IQR and RF=Q3+1.5×IQRRF = Q_3 + 1.5 \times IQR

    4. Scale a horizontal number line to encompass all dataset values (from minimum to maximum).

    5. Draw vertical lines at Q1Q_1, Q2Q_2, and Q3Q_3 and construct the middle box.

    6. Identify fence positions internally.

    7. Draw the left whisker from Q1Q_1 down to the smallest data value that lies inside the fences.

    8. Draw the right whisker from Q3Q_3 up to the largest data value that lies inside the fences.

    9. Mark any data values outside the fences individually using a dot or asterisk.

  • Application to Presidential Age Data:

    • Q1=51Q_1 = 51, Q2=55Q_2 = 55, Q3=60Q_3 = 60

    • LF=37.5LF = 37.5, RF=73.5RF = 73.5

    • Smallest value within fences: 4242 (left whisker extends from 5151 down to 4242

    • Largest value within fences: 7070 (right whisker extends from 6060 up to 7070

    • Value outside fences: 7878 (plotted as an isolated dot at 7878

Comparative Boxplot Analysis

  • Comparative boxplots display two or more boxplots on the same scaled axis to allow direct comparison between groups.

Boxplots for 10 AM and 11 AM Statistics courses
  • Example 7: Comparing Statistics Exam Grades (10 AM vs. 11 AM Sections)

    • Background: A professor taught two back-to-back statistics classes (10 AM and 11 AM) and was concerned that 10 AM students shared exam answers with 11 AM students.

    • Questions & Answers:

    • Question a: Which class had a higher median grade?

      • Answer: The 10 AM class. The median line for the 10 AM section is near 8080, whereas the median for the 11 AM section is below 7070

    • Question b: Which class had a larger IQRIQR?

      • Answer: The 10 AM class. Interquartile range corresponds to box width. The 10 AM box is slightly wider than the 11 AM box, indicating that the middle 50%50\% of scores were spread further apart in the 10 AM class.

    • Question c: Which class had more scores higher than 7070?

      • Answer: The 10 AM class. Over 75%75\% of 10 AM students scored above 7070 (Q1>70Q_1 > 70), while fewer than 50%50\% of 11 AM students scored above 7070 (Median <70< 70

    • Question d: Which class had an outlier?

      • Answer: The 11 AM class had an outlier, shown as a dot near 3131 points.

    • Question e: Based on the boxplots, was the professor's concern justified?

      • Answer: No. The 10 AM class performed significantly better overall. If answer leakages had occurred, the 11 AM class would be expected to score higher, which was not the case.

Boxplots and Distribution Shapes

  • Boxplots reflect the shape of the underlying distribution:

Boxplot shapes for bell-shaped and skewed data
  • Shape Classifications:

    • Symmetric / Bell-Shaped:

    • The middle box is centered between the whiskers.

    • The left and right whiskers are approximately equal in length.

    • The median line divides the box into two roughly equal halves.

    • Skewed Left:

    • The left whisker is significantly longer than the right whisker.

    • The middle box is shifted toward the right side of the diagram.

    • The longer left whisker corresponds to the long left tail seen in a histogram.

    • Skewed Right:

    • The right whisker is significantly longer than the left whisker.

    • The middle box is shifted toward the left side of the diagram.

    • The longer right whisker corresponds to the long right tail seen in a histogram.

Comprehensive Analysis Framework: Putting It All Together

  • Complete Data Description Requirements: Describing a quantitative dataset requires addressing four distinct factors:

    1. Center (Median or Mean)

    2. Variation (IQRIQR, Range, or Standard Deviation)

    3. Shape / Distribution (Symmetric, Skewed Left, Skewed Right)

    4. Outliers (Presence or absence of extreme values beyond fences)

Rotten Tomatoes ratings for Marvel and DC movies
  • Example 8: Comparing Rotten Tomatoes Movie Ratings (Marvel vs. DC through 2019)

    • Center Analysis: Marvel has a significantly higher median rating (near 8080) than DC (near 5252). Marvel's middle box is positioned farther to the right.

    • Variation Analysis: Both companies display roughly equal box widths (IQRIQR). Marvel has a slightly larger total range. Overall variability is approximately equivalent.

    • Shape Analysis:

    • Marvel: Skewed left due to a longer left whisker and a box shifted toward higher values.

    • DC: Symmetric / approximately bell-shaped because the left and right whiskers are nearly equal in length and the box is centered.

    • Outlier Analysis: No dots or asterisks appear on either boxplot; therefore, neither company has outliers.

    • Overall Summary: Marvel's median rating roughly equals DC's third quartile (Q3Q_3

    • 50%50\% of Marvel movies received scores of 8080 or higher.

    • Only 25%25\% of DC movies received scores of 8080 or higher.

    • Marvel movies demonstrate consistently higher critical acclaim while exhibiting similar variation to DC movies.