Login
📚 Online Statistics Education
Chapters ▾
⇩ Download ▾

16.1 Log Transformations

The log transformation can be used to make highly skewed distributions less skewed. This can be valuable both for making patterns in the data more interpretable and for helping to meet the assumptions of inferential statistics.

Figure 1 shows an example of how a log transformation can make patterns more visible. Both graphs plot the brain weight of animals as a function of their body weight. The raw weights are shown in the upper panel; the log-transformed weights are plotted in the lower panel.

Two stacked scatter plots of animal brain weight against body weight. The upper panel plots the raw values — Brain (y, -1000 to 7000) against Body/1000 (x, 0 to 80000) — and almost every point is crushed into the bottom-left corner, with three isolated outliers near (2000, 4600), (4000, 5700), (58000, 6800) and one far right at about (85000, 400); no pattern is visible. The lower panel plots Log(Brain) against Log(Body) and the same animals fall along a clear rising straight-line band from about (1.5, -2) to (18, 8.7).
Figure 1. Scatter plots of brain weight as a function of body weight in terms of both raw data (upper panel) and log-transformed data (lower panel).

It is hard to discern a pattern in the upper panel whereas the strong relationship is shown clearly in the lower panel.

The comparison of the means of log-transformed data is actually a comparison of geometric means. This occurs because, as shown below, the anti-log of the arithmetic mean of log-transformed values is the geometric mean.

Table 1 shows the logs (base 10) of the numbers 1, 10, and 100. The arithmetic mean of the three logs is

(0 + 1 + 2)/3 = 1.

The anti-log of this arithmetic mean of 1 is

101 = 10

which is the geometric mean:

(1 x 10 x 100).3333 = 10.

Table 1. Logarithms.

XLog10(X)
1
10
100
0
1
2

Therefore, if the arithmetic means of two sets of log-transformed data are equal, then the geometric means are equal.

Adapted from Online Statistics Education: A Multimedia Course of Study (onlinestatbook.com), Project Leader: David M. Lane, Rice University. Developed with NSF support. The original work is in the public domain; it is cited here at the authors' request. Changes were made: reformatted as an accessible XYZ web edition with native MathML. License: Public-Domain.