Visualizing outliers with boxplots and the inter-quartile proximity rule
A common way to visualize outliers is by using boxplots. Boxplots provide a standardized display of the variable’s distribution based on quartiles. The box contains the observations within the first and third quartiles, known as the Inter-Quartile Range (IQR). The first quartile is the value below which 25% of the observations lie (equivalent to the 25th percentile), while the third quartile is the value below which 75% of the observations lie (equivalent to the 75th percentile). The IQR is calculated as follows:
Boxplots also display whiskers, which are lines that protrude from each end of the box toward the minimum and maximum values and up to a limit. These limits are given by the minimum or maximum value of the distribution or, in the presence of extreme values, by the following equations:
According to the IQR proximity rule, we can consider a value an outlier if it falls beyond the...