I have a question regarding the scale invariance property of log-log-regression models.
Consider the following model: $$\log (y) = {\beta _0} + {\beta _1}\log (x) + \varepsilon $$
As we know, $\beta_1$ is the elasticity. Furthermore, I've read a couple of times, that the log-log specification is scale invariant, i.e. $\beta_1$ is not affected by the scale of $x$ or $y$.
However, in a simple simulation experiment with the model
$$\log (a+y) = {\beta _0} + {\beta _1}\log (x) + \varepsilon $$
with $a = 1,...,200$ the following graph was produced:
Obviously, $\beta_1$ gets smaller the bigger $a$ gets. This means, that the elasticity decreases, due to adding a constant to the dependent before taking the log.
Question: How does this behaviour correspond to the scale-invariance property of the log-log model?
Thank you in advance for your comments and thoughts. I've also included the code of the simulation below.
# Seed
set.seed(123)
# Simulate data
x <- rnorm(100, mean = 10, sd = 1)
y <- 200 - 10 * x + rnorm(100, sd = 15)
# Apply log
log_x <- log(x)
log_y <- log(y)
# Fit OLS model without offset
mod <- lm(log_y ~ log_x)
summary(mod)
beta <- coef(mod)[2]
# Simulation:
# Add a constant to the dependent, prior to log
max_constant <- 200
for (i in 1:max_constant){
# Add constant to y and take log
log_y <- log(i + y)
# Fit model
mod <- lm(log_y ~ log_x)
# Store coef
beta <- c(beta, coef(mod)[2])
}
# Plots
plot(0:max_constant, beta, xlab = "a", ylab = "Coefficient")