Log-log plots display data in two dimensions where both axes use logarithmic scales. When one variable changes as a constant power of another, a log-log graph shows the relationship as a straight line. In this post, I’ll show you why these graphs are valuable and how to interpret them.
These plots allow us to test whether data fits a power law relationship in the form of Y = kXn and to extract both k and n. If the data points don’t follow a straight line, we know that X and Y do not have a power law relationship. Furthermore, a log-log graph displays the relationship Y = kXn as a straight line such that log k is the constant and n is the slope. Equivalently, the linear function is: log Y = log k + n log X. It’s easy to see if the relationship follows a power law and to read k and n right off the graph!
In this blog post, I work through two example log-log plots to see whether some real-world data follow a power law relationship. It’s also a fantastic illustration of the truth behind John Tukey’s observation that, “The best thing about being a statistician is that you get to play in everyone’s backyard.” I agree enthusiastically!
I love reading and watching scientific material. These are the other backyards that Tukey mentions. My statistical knowledge often helps me to understand the subject matter better. In this case, I was watching and noticed what seemed to be an error in the “Size Matters” episode of the BBC program Wonders of Life. Professor Brian Cox presents a graph that displays the relationship between the mass of mammals and their metabolic rate. And this becomes one of our example log-log plots!
Does the Mass of Mammals Affect Their Metabolism?
Brian Cox is a theoretical physicist and a really smart guy. He’s also one of my favorite science presenters. So, I was surprised when his explanation of a linear regression model appeared incorrect. Below is a closer look at the model he presents, and his interpretation.
Cox points to the straight line and says, “That implies, gram-for-gram, large animals use less energy than small animals . . . because the slope is less than one.”
In linear regression, it doesn’t matter that the slope is less than 1. Instead, the fact that the line is straight tells us that both small and large mammals follow a constant relationship. If you increase mass by 1 gram for both a small mammal and for a large mammal, metabolism rises by the same average amount for both sizes. In other words, gram-for-gram, size doesn’t seem to matter!
However, I didn’t think Cox would make such a fundamental mistake, so I investigated. I found that biologists use log-log plots to display the relationship between mammal mass and their basal metabolic rate. The relationship appears to be a straight line, but it follows a power law.
Scientists use log-log plots for many phenomena that follow power laws. Systems can be complex and cover widely different scales. However, the exponent in a power law relationship remains the same at all scales of a system. You can use power laws to model the sizes of the craters on the power, word frequencies, and earthquakes.
The fact that we’re looking at a log-log plot drastically changes our interpretation. In regression, you can use log-log plots to transform the data to model curvature using linear regression even when it represents a nonlinear function. Let’s analyze similar mammal data ourselves and learn how to interpret the log-log plot.
Example: Log-Log Plot of Mammal Mass and Basal Metabolic Rate
We’ll use the PanTHERIA database to model the relationship between mammal mass and metabolic with a log-log plot. This dataset includes 572 mammals that range from the masked shrew (4.2 grams) to the common eland (562,000 grams)—which is a much larger sample-size than David Cox’s dataset. Here is the CSV data file so you can try both log-log plot examples for yourself: Mammals.
Most statistical software can create a log-log plot. Here’s what it looks like for the mammal dataset.
The data clearly follow a straight line, which indicates they follow a power law relationship. The p-value for the slope (0.7063) is 0.000 (not shown), indicating that it is statistically significant. The R-squared of 94.3% is impressive, particularly when you consider that different researchers collected these data in various settings and included a wide range of mammals from entirely different habits!
Using the constant and slope, we can rewrite it in the power law form:
Metabolic Rate = 0.5758Mass0.7063
The exponent’s value is consistent with recently published estimates.
When a slope on a log-log plot is between 0 and 1, it signifies that the nonlinear effect of the dependent variable lessens as its value increases. For the mammal data, the exponent (0.7063) is in this range, which indicates that as mammals become more massive, the increase in metabolic rate slows down. In other words, gram for gram, larger mammals use less energy than smaller mammals. Or, a cell in a larger mammal uses less energy than a cell in a smaller mammal. This interpretation fits Cox’s explanation in the show.
The fact that the effect of mass on metabolism decreases has significant ramifications. If the increase in metabolic rate had remained constant (linear), humans would need to consume 16,000 calories a day. However, mammals couldn’t grow more massive than a goat due to overheating problems!
Example: Log-Log Plot of Basal Metabolic Rate and Longevity
Let’s look at a how metabolic rate and longevity are related using a log-log plot. These data are in the same dataset we used for the previous example. This time we’re assessing metabolic rate per gram instead of the total metabolic rate.
Again, the data follow a straight line, so we know that the relationship follows a power law, and it is statistically significant (p = 0.000). This time the slope is negative which indicates that as the metabolic rate per gram increases, longevity decreases. The R-squared is 45.8%, which is not bad because this factor is just one of many that can impact maximum lifespan!
We can express the relationship as a power law:
Longevity = 1.879MassPerGram -0.6383
Like the previous log-log plot, this relationship is nonlinear. I’ll graph it below using the natural scale. As the metabolic rate per gram increases, maximum longevity asymptotically approaches a minimum value of 13 months.
On the graph, you can see how a one-unit increase in the slow metabolic rates on the left-side of the chart produces much larger drops in longevity than a one-unit increase in the faster rates.
These two example log-log plots show that size does matter for mammals. More massive mammals tend to have a slower metabolism and tend to live longer. Without a slower metabolism, we’d live only about a year!