2026-11-02

Distribution Shape

  • In statistics, distribution shape of a data set is significant to understand

  • Key shapes covered in my presentation:

  • Symmetric/Normal Distribution

  • Left-Skewed (Negative Skewed) Distribution

  • Right-Skewed(Positive Skewed) Distribution

  • I hope to demonstrate how mean, median, and mode behave differently under each shape.

1. The Normal (Symmetric) Distribution

  • A normal distribution is perfectly symmetrical bell-shaped curve.
  • Central Tendency Relationship:
    • \(\text{Mean} = \text{Median} = \text{Mode}\) Because the distribution is balanced, the peak(mode), the exact middle value (median), and the average (mean) all align at exactly the center.

Math & Formulas: Normal Distribution

  • Probability Density Function: \[\displaystyle f(x) = \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}\]

  • Population Mean and Variance: \[\displaystyle E[X] = \mu, \quad \text{Var}(X) = \sigma^2\]

2. Left-Skewed (Negative Skew) Distribution

  • In a left-skewed distribution, the tail extends out to the left (towards lower) values.
  • Central Tendency Relationship:
    • Mean < Median < Mode
  • Why? The extreme low values in the long left tail pull the mean downward more than the median, while the mode remains at the highest peak on the right.

Math & Metrics: Skewness & Measures

Pearson’s second skewness coefficent relies on the distance between the mean and median: \[\displaystyle \text{Skewness} \approx \frac{3(\text{Mean} - \text{Median})}{\text{Standard Deviation}}\] - If the result is negative, the distribution is left-skewed.

  • If the result is positive, the distribution is right-skewed

3. Right-Skewed (Positive Skew Distribution)

  • In a right-skewed distribution, the tail extends out to the right
  • Central Tendency Relationship:
    • Mode < Median < Mean
  • Why? High outliers in the right tail pull the mean/average up towards the right, making the mean greater than the median and mode.

Visualize Skewness Code

library(ggplot2)
set.seed(42)

# Generating data for Normal, Right-Skewed, and Left-Skewed distributions
skew_data <- data.frame(
  Values = c(
    rnorm(500, mean = 10, sd = 1.5),                 # Normal-like
    rexp(500, rate = 0.5) + 5,                       # Right-Skewed
    -rexp(500, rate = 0.5) + 15                      # Left-Skewed
  ),
  Type = rep(c("Normal", "Right-Skewed", "Left-Skewed"), each = 500)
)

# Plotting the overlapping density curves
comparison_plot <- ggplot(skew_data, aes(x = Values, fill = Type)) +
  geom_density(alpha = 0.5) +
  theme_bw() +
  labs(title = "Comparing Normal, Right-Skewed, and Left-Skewed Distributions",
       x = "Variable Value", y = "Density")

Visualize Skewness Figure

print(comparison_plot)

Numerical Examples

The mean, median, and mode can differ depending on the shape of a distribution.

  • The mean is the average of all values

  • The median is the middle value when the data are ordered

  • The mode is the most frequently occuring value.

Code - Numerical Examples

left_example <- c(1, 8, 9, 10, 10, 10, 12)
normal_example <- c(8, 9, 10, 10, 10, 11, 12)
right_example <- c(8, 10, 10, 10, 11, 12, 30)

mode_value <- function(x) {
  values <- unique(x)
  values[which.max(tabulate(match(x, values)))]
}

example_summary <- data.frame(
  Distribution = c(
    "Left-skewed example",
    "Symmetric example",
    "Right-skewed example"
  ),
  Mean = c(
    mean(left_example),
    mean(normal_example),
    mean(right_example)
  ),
  Median = c(
    median(left_example),
    median(normal_example),
    median(right_example)
  ),
  Mode = c(
    mode_value(left_example),
    mode_value(normal_example),
    mode_value(right_example)
  )
)

central_tendency_table <- knitr::kable(
  example_summary,
  digits = 2,
  caption = "Comparing measures of central tendency"
)

print(central_tendency_table)
## 
## 
## Table: Comparing measures of central tendency
## 
## |Distribution         |  Mean| Median| Mode|
## |:--------------------|-----:|------:|----:|
## |Left-skewed example  |  8.57|     10|   10|
## |Symmetric example    | 10.00|     10|   10|
## |Right-skewed example | 13.00|     10|   10|

Comparing Distribution Shapes

Skewness also describes the asymmetry of a distribution.

  • A symmetric distribution has approximately equal tails.

  • A left-skewed distribution has a longer left tail.

  • A right-skewed distribution has a longer right tail.

The mean is more sensitive to extreme values than the median because the mean uses every value in the dataset.

Comparing Distribution Shapes

set.seed(123)

distribution_data <- data.frame(
  Value = c(
    -rgamma(1000, shape = 5, scale = 1),
    rnorm(1000, mean = 5, sd = 1),
    rexp(1000, rate = 1)
  ),
  Distribution = factor(
    rep(
      c("Left-skewed", "Normal", "Right-skewed"),
      each = 1000
    ),
    levels = c("Left-skewed", "Normal", "Right-skewed")
  )
)

distribution_plot <- ggplot(distribution_data, aes(x = Value)) +
  geom_histogram(
    aes(y = after_stat(density)),
    bins = 30,
    fill = "steelblue",
    color = "white"
  ) +
  facet_wrap(
    ~ Distribution,
    scales = "free"
  ) +
  labs(
    title = "Comparing Distribution Shapes",
    x = "Value",
    y = "Density"
  ) +
  theme_bw()

print(distribution_plot)

Focusing more on Mean and Median: an exploration in a Right-Skewed Distribution

In a right-skewed distribution, extreme high values can increase the mean.

The median is less affected by extreme values because it depends on the middle position of the ordered data.

This is why the median can be a more representative measure of the center when a data set contains unusually high or low values.

Code - Mean and Median

set.seed(123)

center_data <- data.frame(
  Value = rexp(1000, rate = 1)
)

center_values <- data.frame(
  Center = c("Mean", "Median"),
  Value = c(
    mean(center_data$Value),
    median(center_data$Value)
  )
)

Mm_visualization <- ggplot(center_data, aes(x = Value)) +
  geom_histogram(
    aes(y = after_stat(density)),
    bins = 30,
    fill = "steelblue",
    color = "white"
  ) +
  geom_vline(
    data = center_values,
    aes(xintercept = Value, color = Center),
    linewidth = 1,
    linetype = "dashed",
    inherit.aes = FALSE
  ) +
  labs(
    title = "Mean and Median in a Right-Skewed Distribution",
    x = "Value",
    y = "Density",
    color = "Measure"
  ) +
  theme_bw()

print(Mm_visualization)

Conclusion

The shape of a distribution affects how its center should be interpreted.

  • In a symmetric distribution, the mean, median, and mdoe are often similar.

  • In a left-skewed distribution, the mean is typically smaller than the median.

  • In a right-skewed distribution, the mean is typically larger than the median.

Ultimately, visualizing distributions helps identify skewness and understand how extreme values affect measures of central tendency.