Iβm working with primate brain data as a predictor in regression models. In the primate brain literature it is custom to log brain data, but it is unclear to me why. It has been argued that since one gram brain tissue means different things to primates of different size, it is the relative brain volume (among species) that is interesting, hence taking the log (does that make sense?).
By taking the log you enhance the impact of differences in small values in a regression, and the opposite for larger values?
In another post it has been argued that logging a predictor can be approximated with a polynomial regression such that
$π½_{0}+π½_{1}log(π)βπ½_{0}+π½_{1}(πβ1)βπ½_{1}(1/2)(πβ1)^2+π½_{1}(1/3)(πβ1)^3βπ½_{1}(1/4)(πβ1)^4\\=π½^β_0+π½^β_1π+π½^β_2π^2+π½^β_3π^3+π½^β_4π^4$
If this is correct it means that logging a predictor correspond to a certain hypothesis about the relationship between X and Y. And thatβs all it means, or am I missing something?
I have been trying to illustrate this and this is the code I came up with. However, I was expecting the regression lines to be more similar. Am I doing it right?
x <- rlnorm(100, 1)
log.x = log(x)
y <- rnorm(100, x, 5)
a = x-1
b = (1/2*(x-1))^2
c = (1/3*(x-1))^3
d = (1/4*(x-1))^4
f1 <- lm(y ~ a + b + c + d)
f2 <- lm(y ~ log.x)
a <- seq(min(a), max(a), length.out=1000)
b <- seq(min(b), max(b), length.out=1000)
c <- seq(min(c), max(c), length.out=1000)
d <- seq(min(d), max(d), length.out=1000)
t <- predict(f1, newdata = data.frame(a = a, b = b, c = c, d = d))
plot(y ~ log.x)
lines(log(a), t, col = "red")
s <- seq(min(log.x), max(log.x), length.out=1000)
t <- predict( f2, newdata = data.frame(log.x = s))
lines(s, t, col = "blue")