Statalist


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

RE: st: log of zero


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: log of zero
Date   Wed, 2 Jul 2008 12:15:44 +0100

As I understand it, -glm, link(log)-, although otherwise white magic of
the best Dumbledore kind, can do nothing to help with zeros in a
predictor that you want to log. 

Nick 
[email protected] 

Maarten buis

--- Viktor Slavtchev <[email protected]> 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
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

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: http://www.stata.com/statalist/archive/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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