Solved Exercises on Box Plots (Box-and-Whisker Plots)

Master box plots: quartiles, median, outliers, and data distribution analysis through these 5 detailed exercises.

Solution: Exercises 1 to 3
1 Basic Box Plot Construction
Exercise 1
Construct a box plot for the following dataset representing test scores: 85, 76, 92, 88, 79, 94, 82, 87, 91, 83, 78, 89, 95, 86, 84
Definition:

Box plot (box-and-whisker plot): A graphical representation showing the five-number summary of a dataset: minimum, Q1, median (Q2), Q3, maximum.

Construction method:
  1. Arrange data in ascending order
  2. Find the median (Q2)
  3. Find the first quartile (Q1)
  4. Find the third quartile (Q3)
  5. Identify minimum and maximum values
  6. Draw the box plot
Step 1: Arrange data in ascending order

76, 78, 79, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 94, 95

Step 2: Find the median (Q2)

With 15 data points (odd number), median is the middle value at position (15+1)/2 = 8th position

Median (Q2) = 86

Step 3: Find Q1 (first quartile)

Q1 is the median of the lower half (excluding the median if odd count): positions 1-7

Lower half: 76, 78, 79, 82, 83, 84, 85

Q1 = 82 (middle of lower half)

Step 4: Find Q3 (third quartile)

Q3 is the median of the upper half (excluding the median if odd count): positions 9-15

Upper half: 87, 88, 89, 91, 92, 94, 95

Q3 = 91 (middle of upper half)

Step 5: Identify min and max

Minimum = 76, Maximum = 95

Step 6: Five-number summary

Min = 76, Q1 = 82, Median = 86, Q3 = 91, Max = 95

Five-number summary: [76, 82, 86, 91, 95]
Final answer:

The box plot has: Minimum = 76, Q1 = 82, Median = 86, Q3 = 91, Maximum = 95

Box spans from Q1 (82) to Q3 (91), with a line at median (86). Whiskers extend to min (76) and max (95).

Applied rules:

• Quartile calculation: Q1 = median of lower half, Q3 = median of upper half

• Median location: For n data points, median is at position (n+1)/2

• Box plot construction: Box from Q1 to Q3, line at median, whiskers to extremes

2 Outlier Detection
Exercise 2
For the dataset: 12, 15, 18, 20, 22, 24, 25, 26, 28, 30, 32, 35, 40, 55, determine if there are any outliers using the 1.5×IQR rule.
Definition:

Outlier: A data point significantly different from other observations. IQR (Interquartile Range): Q3 - Q1. 1.5×IQR Rule: Values below Q1 - 1.5×IQR or above Q3 + 1.5×IQR are outliers.

Step 1: Arrange data in ascending order

12, 15, 18, 20, 22, 24, 25, 26, 28, 30, 32, 35, 40, 55

Step 2: Find the median (Q2)

With 14 data points (even number), median is average of 7th and 8th values

Median (Q2) = (25 + 26)/2 = 25.5

Step 3: Find Q1 (first quartile)

Q1 is median of first half: positions 1-7

Lower half: 12, 15, 18, 20, 22, 24, 25

Q1 = 20 (4th position)

Step 4: Find Q3 (third quartile)

Q3 is median of second half: positions 8-14

Upper half: 26, 28, 30, 32, 35, 40, 55

Q3 = 32 (11th position)

Step 5: Calculate IQR

IQR = Q3 - Q1 = 32 - 20 = 12

Step 6: Calculate outlier boundaries

Lower boundary = Q1 - 1.5×IQR = 20 - 1.5×12 = 20 - 18 = 2

Upper boundary = Q3 + 1.5×IQR = 32 + 1.5×12 = 32 + 18 = 50

Step 7: Identify outliers

Any value < 2 or > 50 is an outlier

Values: 12, 15, 18, 20, 22, 24, 25, 26, 28, 30, 32, 35, 40, 55

55 > 50, so 55 is an outlier

Outlier detected: 55
Final answer:

The value 55 is an outlier since it exceeds the upper boundary of 50.

Five-number summary excluding outlier: Min = 12, Q1 = 20, Median = 25.5, Q3 = 32, Max = 40

Applied rules:

• IQR calculation: IQR = Q3 - Q1

• Outlier detection: Values outside [Q1 - 1.5×IQR, Q3 + 1.5×IQR]

• Whisker extension: In modified box plots, whiskers extend only to furthest non-outliers

3 Comparing Distributions
Exercise 3
Compare the following two datasets using box plots: Class A: 70, 75, 80, 85, 90, 92, 95 and Class B: 65, 70, 75, 80, 85, 90, 95, 100. Which class has greater variability?
Definition:

Variability: How spread out the data values are. Measured by range, IQR, or standard deviation. Box plot comparison: Compare medians, IQRs, and ranges across multiple datasets.

Step 1: Analyze Class A

Data: 70, 75, 80, 85, 90, 92, 95 (n=7)

Q1 = 75 (median of lower half: 70, 75, 80)

Median = 85

Q3 = 92 (median of upper half: 90, 92, 95)

Min = 70, Max = 95

IQR = 92 - 75 = 17, Range = 95 - 70 = 25

Step 2: Analyze Class B

Data: 65, 70, 75, 80, 85, 90, 95, 100 (n=8)

Q1 = (70 + 75)/2 = 72.5 (average of 2nd and 3rd values)

Median = (80 + 85)/2 = 82.5 (average of 4th and 5th values)

Q3 = (90 + 95)/2 = 92.5 (average of 6th and 7th values)

Min = 65, Max = 100

IQR = 92.5 - 72.5 = 20, Range = 100 - 65 = 35

Step 3: Compare variability measures

Class A: IQR = 17, Range = 25

Class B: IQR = 20, Range = 35

Class B has larger IQR and range, indicating greater variability

Step 4: Compare centers

Class A median = 85, Class B median = 82.5

Class A has slightly higher center

Class B has greater variability (IQR=20 vs 17)
Final answer:

Class B has greater variability than Class A. Class B has a larger IQR (20 vs 17) and range (35 vs 25).

Class A has a slightly higher median (85 vs 82.5).

Applied rules:

• Comparing variability: Larger IQR indicates greater spread in middle 50% of data

• Comparing centers: Compare medians to assess typical values

• Comparing shapes: Look for symmetry or skewness in box plot shapes

Rules and methods, laws,...
IQR = Q3 - Q1
Interquartile Range
Quartiles
Q1 = 25th percentile
Q2 = 50th percentile
Q3 = 75th percentile
Position: (n+1)×percentile/100
Outlier Rule
Lower bound = Q1 - 1.5×IQR
Upper bound = Q3 + 1.5×IQR
Values outside bounds are outliers
Box Plot Components
Min, Q1, Median, Q3, Max
Box spans Q1 to Q3
Key definitions:

Box plot: Visual summary of data distribution using five-number summary

Quartiles: Values dividing ordered data into four equal parts

Median: Middle value when data is arranged in order

Complete methodology:
  1. Sort the data: Arrange values in ascending order
  2. Calculate quartiles: Q1, Q2 (median), Q3
  3. Determine boundaries: Min and max values
  4. Identify outliers: Using 1.5×IQR rule
  5. Draw the plot: Box from Q1 to Q3, whiskers to extremes
Tip 1: Always sort data first before calculating quartiles.
Tip 2: For even number of data points, median is average of middle two values.
Tip 3: Outliers can significantly affect data interpretation.
Tip 4: IQR represents the middle 50% of data values.
Common errors: Misidentifying quartiles, forgetting to sort data, miscalculating IQR.
Exam preparation: Practice finding quartiles for various sample sizes, master outlier detection.
Formulas to know by heart:

• IQR = Q3 - Q1

• Lower outlier boundary = Q1 - 1.5×IQR

• Upper outlier boundary = Q3 + 1.5×IQR

• Quartile position = (n+1) × percentile/100

Solution: Exercises 4 to 5
4 Skewness Analysis
Exercise 4
Analyze the skewness of the dataset: 10, 15, 20, 25, 30, 35, 40, 45, 50, 100 using a box plot. Is the distribution symmetric, skewed left, or skewed right?
Definition:

Skewness: Measure of asymmetry in a distribution. Right-skewed: Tail extends to the right (higher values). Left-skewed: Tail extends to the left (lower values). Symmetric: Balanced around the center.

Step 1: Arrange data in ascending order

10, 15, 20, 25, 30, 35, 40, 45, 50, 100

Step 2: Find quartiles (n=10, even)

Q1 = (20 + 25)/2 = 22.5 (positions 2-3)

Median = (30 + 35)/2 = 32.5 (positions 5-6)

Q3 = (45 + 50)/2 = 47.5 (positions 8-9)

Step 3: Calculate IQR and check for outliers

IQR = Q3 - Q1 = 47.5 - 22.5 = 25

Lower boundary = 22.5 - 1.5×25 = -15

Upper boundary = 47.5 + 1.5×25 = 85

Value 100 > 85, so 100 is an outlier

Step 4: Analyze skewness

Without outlier: Min = 10, Q1 = 22.5, Median = 32.5, Q3 = 47.5, Max = 50

Distance from Q1 to median = 32.5 - 22.5 = 10

Distance from median to Q3 = 47.5 - 32.5 = 15

Distance from Q3 to max = 50 - 47.5 = 2.5

Step 5: Determine skewness

The right side (from median to Q3 and beyond) is longer than the left side

This indicates a right-skewed distribution

Right-skewed distribution
Final answer:

The distribution is right-skewed. The distance from median to Q3 (15) is greater than from Q1 to median (10), and there's an outlier at 100 pulling the distribution to the right.

Applied rules:

• Skewness identification: Compare distances between quartiles and median

• Right skew: Longer tail on right side, Q3-Median > Median-Q1

• Outlier effect: Extreme values often indicate skewness

5 Interpreting Percentiles
Exercise 5
A box plot of test scores has Q1 = 72, Median = 78, and Q3 = 85. What percentage of students scored between Q1 and Q3? What score separates the top 25% from the bottom 75%?
Definition:

Percentiles: Values below which a certain percentage of data falls. Q1 (25th percentile): 25% of data below this value. Q3 (75th percentile): 75% of data below this value.

Step 1: Understand quartile definitions

Q1 = 25th percentile: 25% of data ≤ 72

Q2 (median) = 50th percentile: 50% of data ≤ 78

Q3 = 75th percentile: 75% of data ≤ 85

Step 2: Calculate percentage between Q1 and Q3

Between Q1 and Q3: From 25th percentile to 75th percentile

Percentage = 75% - 25% = 50%

Step 3: Identify score separating top 25%

The score that separates the top 25% from bottom 75% is the 75th percentile

This is Q3 = 85

Step 4: Additional interpretations

25% of students scored below 72

50% of students scored between 72 and 85

25% of students scored above 85

50% between Q1 and Q3; 85 separates top 25%
Final answer:

50% of students scored between Q1 (72) and Q3 (85).

The score 85 separates the top 25% from the bottom 75% of students.

Applied rules:

• Quartile percentages: Q1 = 25%, Median = 50%, Q3 = 75%

• Between quartiles: 50% of data always between Q1 and Q3

• Percentile interpretation: Pth percentile means P% of data ≤ that value

Comprehensive Guide to Box Plot Interpretation and Analysis
IQR = Q3 - Q1
Interquartile Range Calculation
Key definitions:

Box plot (box-and-whisker plot): A standardized way of displaying the distribution of data based on a five-number summary: minimum, first quartile (Q1), median (Q2), third quartile (Q3), and maximum.

Quartiles: Three values that divide ranked data into four equal parts: Q1 (25th percentile), Q2 (median, 50th percentile), Q3 (75th percentile).

Interquartile Range (IQR): The range of the middle 50% of the data, calculated as Q3 - Q1.

Complete methodology:
  1. Organize Data: Sort the data in ascending order
  2. Find Median (Q2): Middle value of the dataset
  3. Find Q1: Median of the lower half (values below the median)
  4. Find Q3: Median of the upper half (values above the median)
  5. Identify Extremes: Minimum and maximum values
  6. Calculate IQR: Q3 - Q1
  7. Detect Outliers: Values outside [Q1 - 1.5×IQR, Q3 + 1.5×IQR]
  8. Construct Plot: Draw box from Q1 to Q3 with median line, whiskers to extremes
Tip 1: Always arrange data in ascending order before calculating quartiles.
Tip 2: For odd number of data points, exclude the median when finding Q1 and Q3.
Tip 3: For even number of data points, include all values when finding Q1 and Q3.
Tip 4: The box contains the middle 50% of the data, regardless of distribution shape.
Tip 5: Outliers may indicate unusual events or data collection errors.
Tip 6: Compare medians to assess central tendency differences between groups.
Skewness Indicators: If the median is closer to Q1, the distribution is right-skewed. If closer to Q3, it's left-skewed. If centered, it's approximately symmetric.
Variability Assessment: Compare IQRs to assess which dataset has more spread in the middle 50% of values. Longer boxes indicate greater variability.
Outlier Impact: Outliers can significantly affect the appearance of a box plot and should be investigated for their cause.
Essential formulas and rules:

• Quartile position: For nth data point, position = (n+1) × percentile/100

• Interquartile Range: IQR = Q3 - Q1

• Outlier boundaries: Lower = Q1 - 1.5×IQR, Upper = Q3 + 1.5×IQR

• Percentile interpretation: Pth percentile means P% of data values are ≤ that value

• Box plot components: Box spans Q1 to Q3, line at median, whiskers to extremes (or to furthest non-outliers)

Visual Analysis: Box Plot Characteristics
Understanding Box Plot Features
Different box plot shapes reveal important characteristics about data distributions:
Symmetric: Median centered in box, whiskers roughly equal
Right-skewed: Median closer to Q1, longer right whisker
Left-skewed: Median closer to Q3, longer left whisker
Outliers: Points beyond whiskers

Analysis: Box plots provide a concise summary of data distribution, highlighting central tendency, variability, and potential outliers.

  • The box represents the middle 50% of data (IQR)
  • The median line shows the center of the distribution
  • Whiskers indicate the range of non-outlier data
  • Outliers are shown as individual points beyond whiskers

Questions & Answers

Question: I'm confused about how to find quartiles when there's an even number of data points. Can you explain the difference between finding quartiles for odd vs even sample sizes?

Answer: Great question! The method differs based on sample size:

  • Odd number of data points: The median is the actual middle value. For quartiles, split the data into two halves excluding the median. Q1 is the median of the lower half, Q3 is the median of the upper half.
  • Even number of data points: The median is the average of the two middle values. For quartiles, split the data into two equal halves including both middle values. Q1 is the median of the first half, Q3 is the median of the second half.

Example with odd n=7: 1, 2, 3, 4, 5, 6, 7
Median = 4 (exclude from halves)
Lower half: 1, 2, 3 → Q1 = 2
Upper half: 5, 6, 7 → Q3 = 6

Example with even n=8: 1, 2, 3, 4, 5, 6, 7, 8
Median = (4+5)/2 = 4.5
Lower half: 1, 2, 3, 4 → Q1 = (2+3)/2 = 2.5
Upper half: 5, 6, 7, 8 → Q3 = (6+7)/2 = 6.5

Question: When I have outliers in my data, how does that affect the interpretation of the box plot? Should I always remove outliers?

Answer: Outliers provide valuable information and should not be automatically removed. Here's how to interpret box plots with outliers:

  • Modified box plots: Whiskers extend only to the furthest non-outlier values, with outliers shown as individual points beyond the whiskers.
  • Outlier significance: They might indicate unusual events, measurement errors, or interesting phenomena worth investigating.
  • Impact on interpretation: Outliers don't change the quartiles but can make the distribution appear more spread out than it actually is in the central portion.

Before removing outliers, investigate their cause. Only remove them if they represent errors or if specifically instructed. Otherwise, analyze both with and without outliers to understand their impact on the distribution.

Remember: The box still represents the middle 50% of data regardless of outliers, so the core distribution characteristics remain visible.

Question: How can I determine if a distribution is skewed just by looking at a box plot? What specific features should I focus on?

Answer: Box plots provide clear visual cues for skewness. Focus on these features:

  • Median position: If the median line is closer to Q1, the distribution is right-skewed. If closer to Q3, it's left-skewed. If centered, it's approximately symmetric.
  • Box position: The relative position of the box within the whiskers indicates skewness direction.
  • Whisker length: Longer whiskers on one side suggest skewness in that direction.

Right-skewed: Median closer to Q1, longer right whisker, tail extends toward higher values

Left-skewed: Median closer to Q3, longer left whisker, tail extends toward lower values

Symmetric: Median centered in box, whiskers roughly equal in length

Remember that extreme outliers can sometimes distort the visual appearance, so consider the overall pattern of the box and most of the whiskers.

Question: How do I compare two box plots to determine which dataset has greater variability? Are there different ways to measure this?

Answer: There are several ways to compare variability using box plots:

  1. Compare IQRs (Interquartile Ranges): The width of the box represents the IQR. A wider box indicates greater variability in the middle 50% of the data.
  2. Compare ranges: The total span from minimum to maximum (including outliers) gives the overall range. Larger range suggests greater variability.
  3. Compare whisker lengths: Longer whiskers indicate data extending further from the central values.

The IQR is often preferred because it's resistant to outliers and focuses on the central portion of the data. However, comparing both IQR and range provides a complete picture.

Additional considerations:

  • Look at the overall spread indicated by whiskers
  • Consider the presence of outliers in each dataset
  • Compare the symmetry or skewness of both distributions

In general, the dataset with the larger IQR has greater variability in its central values.

Question: What's the practical significance of the 1.5×IQR rule for identifying outliers? Why was this specific multiplier chosen?

Answer: The 1.5×IQR rule was developed by statistician John Tukey as a balance between sensitivity and robustness:

  • Practical purpose: It identifies values that are unusually far from the central bulk of the data while avoiding flagging too many normal values as outliers.
  • Mathematical basis: For normally distributed data, this rule captures approximately 99.3% of the data within the boundaries, making it quite effective.
  • Balance: The 1.5 multiplier is large enough to avoid flagging moderate deviations as outliers but small enough to catch truly extreme values.

Alternative multipliers exist for different purposes:

  • 1.0×IQR: More sensitive, catches more potential outliers
  • 2.0×IQR: Less sensitive, fewer values flagged as outliers
  • 3.0×IQR: Very conservative, only extremely distant values flagged

The 1.5×IQR rule strikes a good balance for exploratory data analysis, helping identify potentially interesting or problematic values without being overly aggressive in classification.