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

RE: st: reverse prediction - confidence interval for x at given y in nonlinear model

From   "Nick Cox" <>
To   <>
Subject   RE: st: reverse prediction - confidence interval for x at given y in nonlinear model
Date   Fri, 26 Oct 2007 17:14:08 +0100

The idea of a dummy for zero dose is interesting but doesn't seem to map
on the kind of model being discussed here. 

More importantly, that does nothing to solve the major issue, which is
thinking up a good alternative to log(0). Replacing log(0) by 0 is
equivalent to replacing 0 by 1 in whatever units are being used. How
sensible that is will depend partly on the range of the data. If the
rest of the data were 0.1 to 0.5 it would be crazy! 

The problem in general is that mapping 0 to a very small number creates
a very large negative logarithm. Although I guess that there must be
other solutions, one is to do a sensitivity analysis of varying choices
of c in log(x + c), or cond(x == 0, c, log(x)). 


Daniel Waxman

Regarging the treatment of zeroes in log(dose):

Since zero likely reflects a qualitatively different situation than
small values of dose you are better off treating it as such.  Here is a
trick to get stata to do what you want:

gen ldose = log(dose)
gen zdose = 1 - (dose == 0)
replace ldose  = 0 if dose == 0
logit outcome ldose zdose ...

Thus ldose is a term which represents log dose for positive values, and
falls out for doses of zero.  zdose is a dummy which is zero for doses
of zero and one otherwise.  If you look at the model as:

logit outcome ldose*zdose zdose

and look at what happens as dose (untransformed) becomes infinitesimal,
you can see how this works.

*   For searches and help try:

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