[R] A modified log transformation with real finite values for negatives and zeros?

Spencer Graves spencer.graves at pdf.com
Wed Feb 2 20:28:26 CET 2005


      Does anyone have any ideas (or even experience) regarding a 
modified log transformation that would assign real finite values to 
zeros and negative numbers?  I encounter this routinely in a couple of 
different situations: 

      * Physical measurements that are often lognormally distributed 
except for values that are less than additive normal measurement error.  
I'd like to take logarithms of the clearly positive values and assign 
some smaller finite number(s) for values less than or equal to zero.  I 
also might like to decompose the values into mean plus variance of the 
logs plus variance of additive normal noise.  However, that would 
require more machinery than is appropriate for exploratory data analysis. 

      * Integers most of which are plausibly Poisson counts but include 
a few negative values.  People in manufacturing sometimes report the 
number of defects "added" between two steps in the process, computed as 
the difference between the number counted before and after intervening 
steps.  These counts are occasionally negative either because defects 
are removed in processing or because of a miscount either before or after. 

      For an example, see "www.prodsyse.com/log0".  There, you can also 
download working R code for such a transformation along with PowerPoint 
slides documenting some of the logic behind the code.  It's not included 
here, because it's too much for a standard R post. 

      Comments? 
      Thanks,
      spencer graves




More information about the R-help mailing list