[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Handling 0 values when using logs of a dependent variable

From   Rich Steinberg <>
Subject   Re: st: Handling 0 values when using logs of a dependent variable
Date   Wed, 15 Jul 2009 12:38:02 -0400

If, instead of just replacing the zeros, you add a small number (1 or 10) to every left hand variable b4 taking logs, you are not doing anything except slightly translating the origin of the log log curve. (of course, adjust the lower limit of the tobit if you do this). Since you probably have no reason to believe that the log-log curve ought to be centered at any particular point, this is ok -- you could even try different values of the constant to see which gives you the best fit.

Whether you want to do this or the other ideas suggested by Austin depends on what the residuals look like for each. It is a combination of a functional form and error distribution question.

Austin Nichols wrote:
Dana Chandler<> :
The log of zero is missing for a reason, as the quantity is undefined.
You should ignore the advice of anyone who suggests replacing the
zeros with ones before taking logs, which is demonstrably wrong, as is
the sometimes used strategy of replacing the zeros with a value (call
it u) smaller than any observed positive value, taking logs, then
applying -tobit- with a lower limit at ln(u). OTOH, -poisson- or -glm-
with a log link regressing y on x will give you results comparable to
regressing ln(y) on x and includes the y=0 cases in a natural way.
Make sure you use robust SEs and see also the help file for -ivpois-
on SSC.

On Wed, Jul 15, 2009 at 9:17 AM, Dana Chandler<> wrote:
I would like to run a regression of a given variable's log on another
set of variables. How should I handle the 0 values?

I have searched for an answer and saw some people say that "you cannot
run a regression with logs on values of zero... those values should be
considered 'missing' in the regression." Another suggestion was to
replace the 0s with 1s.

Any thoughts?

Thanks in advance,
*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index