<p>The elasticity of Y with respect to X is often estimated by running a regression like this:
<span class="math-container">$$ \ln Y = \alpha + \beta \ln X + error$$</span></p>

<p>However, this isn't always applicable because it is perfectly fine to ask what is the percent change in Y to a percent change in X even if X or Y are negative. There are other issues too, like the fact that the elasticity may not be constant over X. </p>

<p>Let's go back to the textbook (<a href="https://rads.stackoverflow.com/amzn/click/com/B01JXTU60C" rel="nofollow noreferrer" rel="nofollow noreferrer">Varian (1992), p. 235</a>) for the definition of the elasticity of <span class="math-container">$Y$</span> with respect to <span class="math-container">$X$</span>:
<span class="math-container">$$ \epsilon(Y,X) =\frac{\partial Y}{\partial X} \cdot \frac{X}{Y} $$</span>
Which equals another common definition of the elasticity:
<span class="math-container">$$=\frac{\partial \ln Y}{\partial \ln X}$$</span>
which we often use when estimating the elasticity with linear regressions. </p>

<p>However, the advantage of the first form is that you don't have to use the log function to evaluate it. All you need is a local estimate of the derivative, X, and Y. 
One strategy would be just to do that. </p>

<p>However, what you are doing could well be nonsensical because percentage changes are weird when working with negative values. For example, consider X going from -11 to -10. This is a 9.1 percent decrease in X ((-10-11)/-11). However, this is is an increase in X! Going from 11 to 10 is also a 9.1 percent decrease in X. What would be the economic conditions where we think going from -11 to -10 and +11 to +10 would have the same effect on demand? </p>

CC BY-SA 4.0
2019-06-07T15:02:59.527Z
2019-06-07T15:02:59.527Z
BKay
<p>I am trying to us a Log-linear model to derive an elasticity. However, some of my Xs are negative numbers. Being as the model relies on the natural log of the Ys and the Xs, how can this model work when the natural log can only be taken of X>0? </p>

CC BY-SA 4.0
2019-06-07T09:56:16.993Z
There are a few tricks. A good one is to transform the variable to a positive only number. If your variable is a net value, maybe a gross value would be more appropriate. Can you be more specific?
Jamzy
CC BY-SA 4.0
2019-06-07T10:02:33.747Z
Sure thing: my Xs are observations of liquidity gaps, most of which tend to be in surplus, but some of which are also deficits (hence the negative numbers). I thought about what you said and considered perhaps taking the absolute values of all the numbers but I'm not confident that this is the right way to find a meaningful elasticity.  I am also wondering how legitimate of a workaround adding some constant to all the Xs (and the Ys?) would be?
Maddy
CC BY-SA 4.0
2019-06-07T10:18:28.213Z
(p.s. I also realize you were't suggesting using absolute values -- this was just my first impulse to get around negative numbers)
Maddy
CC BY-SA 4.0
2019-06-07T14:46:22.037Z
Adding some arbitrary constant is usually not recommended, unfortunately. I'm just thinking here... If you have a gap, that's a gap between two positive numbers. what about the log difference between the two. If your gap is defined as a-b, why not try log(a)-log(b). Might give you something meaningful.
Jamzy
<elasticity><log-linearization>
How do you use a Log-linear model when you have negative Xs?
Maddy
# How do you use a Log-linear model when you have negative Xs?

(Asked by: username_0 on 2019-06-07)

I am trying to us a Log-linear model to derive an elasticity. However, some of my Xs are negative numbers. Being as the model relies on the natural log of the Ys and the Xs, how can this model work when the natural log can only be taken of X>0?

**Tags:** elasticity, log-linearization

> **Comments:**
> **username_1**: There are a few tricks. A good one is to transform the variable to a positive only number. If your variable is a net value, maybe a gross value would be more appropriate. Can you be more specific?  
> **username_0**: Sure thing: my Xs are observations of liquidity gaps, most of which tend to be in surplus, but some of which are also deficits (hence the negative numbers). I thought about what you said and considered perhaps taking the absolute values of all the numbers but I'm not confident that this is the right way to find a meaningful elasticity.  I am also wondering how legitimate of a workaround adding some constant to all the Xs (and the Ys?) would be?  
> **username_0**: (p.s. I also realize you were't suggesting using absolute values -- this was just my first impulse to get around negative numbers)  
> **username_1**: Adding some arbitrary constant is usually not recommended, unfortunately. I'm just thinking here... If you have a gap, that's a gap between two positive numbers. what about the log difference between the two. If your gap is defined as a-b, why not try log(a)-log(b). Might give you something meaningful.  

---

## 1 answers

### Answer by username_2 on 2019-06-07. Score: 2

The elasticity of Y with respect to X is often estimated by running a regression like this:
$$ \ln Y = \alpha + \beta \ln X + error$$

However, this isn't always applicable because it is perfectly fine to ask what is the percent change in Y to a percent change in X even if X or Y are negative. There are other issues too, like the fact that the elasticity may not be constant over X.

Let's go back to the textbook ([Varian (1992), p. 235](https://rads.stackoverflow.com/amzn/click/com/B01JXTU60C)) for the definition of the elasticity of $Y$ with respect to $X$:
$$ \epsilon(Y,X) =\frac{\partial Y}{\partial X} \cdot \frac{X}{Y} $$
Which equals another common definition of the elasticity:
$$=\frac{\partial \ln Y}{\partial \ln X}$$
which we often use when estimating the elasticity with linear regressions.

However, the advantage of the first form is that you don't have to use the log function to evaluate it. All you need is a local estimate of the derivative, X, and Y.
One strategy would be just to do that.

However, what you are doing could well be nonsensical because percentage changes are weird when working with negative values. For example, consider X going from -11 to -10. This is a 9.1 percent decrease in X ((-10-11)/-11). However, this is is an increase in X! Going from 11 to 10 is also a 9.1 percent decrease in X. What would be the economic conditions where we think going from -11 to -10 and +11 to +10 would have the same effect on demand?


---

