<p>Taking the logarithm of <span class="math-container">$0$</span> is impossible. This is a frequent occuring problem with econometricians who insist on using the log transform while having data with (many) zeros.</p>
<p>There are a few options, none of which is entirely satisfying:</p>
<ul>
<li>drop the data for which the dependent observable is zero (this raises issues of sample bias).</li>
<li>Use another transformation that is &quot;sufficiently&quot; close to the log transform. The inverse hyperbolic sine function is very popular (however one should be careful in interpreting the coefficients, see for example <a href="https://marcfbellemare.com/wordpress/wp-content/uploads/2019/02/BellemareWichmanIHSFebruary2019.pdf" rel="noreferrer">Bellemare and Wichman (Elasiticites and the Inverse hyperbolic sine transformation)</a></li>
<li>Use a different econometric specification. If you have count data (like in your case), a Poisson (or negative binomial) specification might be more appropriate.</li>
</ul>
<p>Simply adding a 1 to all data to avoid observations with 0 is (I think) not a very good idea as it is unclear how to interpret the estimated coefficients. However, there might be others that disagree with me on this.</p>

CC BY-SA 4.0
2023-08-17T15:59:50.880Z
I was told, that a "common practice" is to add half of the minimum value or just add a very small number. However that both doesn't seem quite right. Thanks for the help. I will try these options you mentioned.
Pajul
CC BY-SA 4.0
2023-08-17T09:19:48.937Z
2023-08-17T09:19:48.937Z
tdm
<p>I am trying to log transform data on slave trade voyages from the Database by David Eltis,The Trans-Atlantic Slave Trade Database.</p>
<p>The Problem I am facing: Many values are 0. My first idea was to assign value 1 to all values which are 0, so after log transforming they are 0. However, since I am taking average voyages per year, for many years the value is &lt; 1, leading to negative values after the log transformation.</p>
<p>So now I have smaller values for years in which there was slave trade (but &lt;1) compared to years when there was no slave trade.</p>
<p>How does one adress such a problem?</p>

CC BY-SA 4.0
2023-08-28T00:02:42.653Z
You might want to consult this working paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3444996
Hopeless Economist
<econometrics><applied-econometrics>
Log Transformation of Zeros (Slave Trade Data)
Pajul
# Log Transformation of Zeros (Slave Trade Data)

(Asked by: username_0 on 2023-08-17)

I am trying to log transform data on slave trade voyages from the Database by David Eltis,The Trans-Atlantic Slave Trade Database.

The Problem I am facing: Many values are 0. My first idea was to assign value 1 to all values which are 0, so after log transforming they are 0. However, since I am taking average voyages per year, for many years the value is < 1, leading to negative values after the log transformation.

So now I have smaller values for years in which there was slave trade (but <1) compared to years when there was no slave trade.

How does one adress such a problem?

**Tags:** econometrics, applied-econometrics

> **Comments:**
> **username_1**: You might want to consult this working paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3444996  

---

## 1 answers

### Answer by username_2 on 2023-08-17. Score: 6 | Accepted answer

Taking the logarithm of $0$ is impossible. This is a frequent occuring problem with econometricians who insist on using the log transform while having data with (many) zeros.

There are a few options, none of which is entirely satisfying:

* drop the data for which the dependent observable is zero (this raises issues of sample bias).
* Use another transformation that is "sufficiently" close to the log transform. The inverse hyperbolic sine function is very popular (however one should be careful in interpreting the coefficients, see for example [Bellemare and Wichman (Elasiticites and the Inverse hyperbolic sine transformation)](https://marcfbellemare.com/wordpress/wp-content/uploads/2019/02/BellemareWichmanIHSFebruary2019.pdf)
* Use a different econometric specification. If you have count data (like in your case), a Poisson (or negative binomial) specification might be more appropriate.

Simply adding a 1 to all data to avoid observations with 0 is (I think) not a very good idea as it is unclear how to interpret the estimated coefficients. However, there might be others that disagree with me on this.

> **Comments:**
> **username_0**: I was told, that a "common practice" is to add half of the minimum value or just add a very small number. However that both doesn't seem quite right. Thanks for the help. I will try these options you mentioned.  

---

