[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: log of zero

From   Maarten buis <>
Subject   Re: st: log of zero
Date   Wed, 2 Jul 2008 11:29:37 +0100 (BST)

--- Viktor Slavtchev <> wrote:
> I want to estimate production function in logs in order to interpret
> the coefficients in terms of elasticities. one of the RHS variables
> has a lot of zero value. in such cases, some people usually add a
> very small value in order to avoid the problem of 'undefined' log of
> zero. a similar issue was discussed some time ago among other things
> and in a quite different context but an interesting alternative
> suggestion was made (which I can't remember anymore). unfortunately,
> I was not able to find this particular thread.

I think you are refering to using -glm- with the log link, like in the
example below. 

*----------- begin example ----------------
sysuse nlsw88, clear

/* create some zeros */
recode grade 0/11 = 0

gen lnage = ln(age)
xi: glm grade lnage i.race south, link(log)
*----------- end example ------------------
(For more on how to use examples I sent to the Statalist, see )

When searching the archive of Statalist it may be helpful to know that
in the archive of the statalist hosted by StataCorp there is a good
search function, see:

Hope this helps,

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo!
*   For searches and help try:

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