Course contentsShow
← Data Science
Lesson 212 of 2,1456. The Normal Distribution in DepthFree lesson

Log Transformations

Apply logarithmic transformations to right-skewed data to reduce skewness and stabilize variance.

Log Transformations

You'll learn: How to use logarithmic transformations to reshape right-skewed data into a more normal distribution.

What Is a Log Transformation?

A log transformation applies the logarithm function (usually natural log, ln, or base-10 log) to each value in your dataset. This mathematical operation compresses large values much more than small values, which can "pull in" the long right tail of skewed data.

Think of it like adjusting volume levels: whispers (small values) stay relatively the same, but shouts (large values) get turned down dramatically, bringing everything into a more balanced range.

Why Use Log Transformations?

When data is right-skewed (long tail stretching to the right), it violates the symmetry assumption of the normal distribution. Many statistical methods work best with normally distributed data. Log transformations help by:

  1. Reducing skewness – Converting the stretched-out tail into a more symmetric bell shape
  2. Stabilizing variance – Making the spread of data more consistent across different ranges
  3. Making multiplicative relationships additive – Easier to model and interpret

When to Apply Log Transformations

Use log transformations when:

  • Your histogram shows a long right tail (right skew)
  • Your Q-Q plot curves away from the diagonal line at the upper end
  • Your data involves quantities that grow exponentially (income, population, reaction times)

Important: Log transformations only work on positive values. If you have zeros or negatives, you'll need to adjust first (e.g., add a small constant).

Key Takeaway: Log transformations are your go-to tool for taming right-skewed data, compressing large values proportionally more than small ones to achieve approximate normality and stabilize variance.