# What is the mathematical meaning of when two variables retain a non-linear relationship even after log transformation?

I am working with a set of biological data drawn from a sample of species, specifically a skeletal measurement and body size, with the intent of calculating a regression line to try to predict the body size of new data given the skeletal measurement. As with many biological data, both variables show a log-normal distribution and so I transformed both using a natural logarithm to normalize them.

However, even after transforming both the x and y variables the data does not form a straight line. Visual inspection shows the data is slightly curved and plotting a linear trendline does not accurately fit the distribution of the data.

However, it turns out a power function of $$log(body mass) ∝ log(measurement)^{2/3}$$ linearizes it. Similarly, non-linear curve-fitting using the nls function in R finds the best exponent in a power function is that of 2/3, and the 95% confidence interval for the exponent clearly rules out a linear relationship between the two variables. In addition...

• The AIC and BIC for a non-linear model (either a power model or a quadratic one) is much lower than for a linear model.
• The residuals versus fitted plot for a linear model is distinctly curved

• The 95% confidence intervals for a Box-Cox plot for a log-linear model do not overlap with 1, indicating the data is not linearized. Lambda is approximately 1.2, which doesn't appear to suggest a quadratic model is the optimal solution.

• When fitting a quadratic model to the data the second-order term is recovered as having a statistically important effect.
• Because this is biological data I also tested if this effect could be due to phylogenetic influence in the data. I got the same curvilinear result even under PGLS.
• Plotting best-fit lines for different size classes seem to indicate a larger magnitude of $$δy/x$$ at larger sizes (specifically, there is a greater-per-unit increase in the measurement at larger sizes).

So the trend definitely seems to be a real pattern and not the result of a statistical artifact.

At first, I mistakenly believed this was a case of negative allometry, specifically that a 2/3 relationship caused by the square-cube law. However, upon looking further into the literature it seems as though a relationship is only considered negatively allometric if the untransformed x variable scales to the y at a fractional exponent, and the regression line between the two log-transformed variables in that case is still assumed to be linear. That is, rather than...

$$log(body mass) ∝ log(measurement)^{2/3}$$

it should be...

$$measurement ∝ body mass^{2/3}$$

I looked into this some more and the presence of non-linearity after log-transformation appears to be a more broadly distributed issue in the biological sciences that some have termed non-linear allometry. However, in the biological sciencs despite there being awareness of this issue (i.e., here and here), none of these studies attempt to discuss the mathematical basis for this relationship or what it means in terms of biology (e.g., akin to a 2/3 exponent being related to an area-to-volume relationship).

Additionally, it does not appear as though treating this relationship as close enough to approximating a log-linear model works. Specifically, I've noticed that controversial results in some previous studies are the result of treating this relationship as log-linear rather than non-linear and using it for prediction.

Is there a term for what happens when the relationship between two variables is best modelled by a non-linear power law even after both are log-transformed, or any mathematical basis for this pattern? I am trying to figure out if this pattern and the physical meaning thereof is known in other areas.

• People might be curious to know what X and Y represent.. Commented Nov 1, 2020 at 0:28
• @HarveyMotulsky X is a linear measurement on the specimen whereas Y is weight. Commented Nov 1, 2020 at 2:29
• log-distributed is not a thing in statistics. There is a logarithmic distribution, which I don't think you are referring to. I guess this is personal shorthand for "my data are easier to work with on log scale", which is much better wording. Commented Oct 16, 2021 at 11:13
• Consider emulating the analysis at stats.stackexchange.com/a/35717/919 to estimate Box-Cox transformations for both variables.
– whuber
Commented Oct 18, 2021 at 16:40

You might have a case with a sum of components

$$y = a_1x^{n_1} + a_2x^{n_2} + ...$$

See below how it looks like in a log-log plot. It is a curve that bends at some point and goes from one straight line over into another straight line.

Is there a term for what happens when the relationship between two variables is best modelled by a non-linear power law even after both are log-transformed, or any mathematical basis for this pattern?

Non-linear relationships are encountered a lot in chemical engineering (e.g. see the graphs on how to fit different parts of a log-log plot).

There is not really a name for it. It just means that the relationship is not a power law.

You might model it as a polynomial

$$\log y = b_1 + b_2 \log(x) + b_3 \log(x)^2 + \dots$$

But such form is often not related to an underlying mechanistic model. It would be better to come up with a form that has a better mechanistic interpretation.

One way would be the function above with multiple components and you can interpret the case with two components as two regimes with different exponential coeffients and different allometry.

• That might be the case. Though the curvilinearity of the data seems pretty gradual. If you want, I added more information to the question given I posted this question a while ago and I misstated the context of the problem then. Commented Oct 17, 2021 at 20:26
• @user2352714 your plot has a range for the $x$ variable in the order of $10^2$. The plot that I made has a range in the order of $10^6$. Commented Oct 17, 2021 at 20:41

If you're implying that you're working, or intending to work, with log of log, that is in principle a dubious beast. Suppose your raw data are $$x$$ and $$y$$ and you work with $$\ln x$$ and $$\ln y$$. Naturally either logarithm will be zero or negative if either variable is ever $$\le 1$$. If so then consider (say) $$\ln (\ln x)$$: that is not defined (usefully for this context) for values of $$x \le 1$$ (the same applies to any other variable).

That makes whether log of log will appear to work dependent on your units of measurement (or equivalently on the base of logarithms used, which need not be e, 10 or 2, except for convention or convenience).

Otherwise put, if it appears that you need to take logarithms twice, that is essentially illusion and the explanation lies elsewhere. The negative explanation for curvature on a log-log plot is simply that you do not have (a good approximation to) a power law. The positive explanation for what you do have is an open question without more information.

• Apologies, I misspoke when I was originally describing the issue. I do not mean that I took the log twice, merely that I took the natural log of both the dependent and independent variable. I have added more information to clarify the issue. Commented Oct 17, 2021 at 20:24
• No need to apologise, but note this. If you think $\log y$ is a power function of $\log x$, you need to estimate the coefficients without using logarithms again. IIUC, you're using nonlinear least squares, which seems all right; Commented Oct 17, 2021 at 21:10