[R-sig-ME] adding a constant to a continuous dataset with zero values- to use the log transformation

Thierry Onkelinx thierry.onkelinx at inbo.be
Tue Apr 3 12:05:15 CEST 2018

Dear Ahmad,

Don't do log(x+1). If you want to see why, then to the analysis with
log(x+1), log(x+100), log(x+0.001), ... and compare the results.

What is causing the zeros? Are they non-detects? Then you need threat
this as censored data (see the NADA package). If they are not, then a
zero-inflated gamma distribution might be an option.

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx at inbo.be
Havenlaan 88 bus 73, 1000 Brussel

To call in the statistician after the experiment is done may be no
more than asking him to perform a post-mortem examination: he may be
able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does
not ensure that a reasonable answer can be extracted from a given body
of data. ~ John Tukey

2018-04-03 11:42 GMT+02:00 Ahmad <ahmadr215 at tpg.com.au>:
> Hi all
> My question here is related to my previous query on Geometric mean of log
> data.
> I have a continuous dataset with considerable number of zero values, and
> not-normally distributed. Because of zero values, I won't be able to take
> the log of this variable. It has been suggested by some to add a constant
> (e.g. +1) to all data to be able to take the log of data. I can then
> transform back the output of lm() or Mixed-model to the original scale using
> exp() or emmeans function with "response" method as suggested by Russell
> (russell-lenth at uiowa.edu).
> I searched this (adding a constant) and found that views on this approach
> are not consistent- I would like to see if anyone has experience on how to
> deal with such data.
> Your help is greatly appreciated!
> Ahmad
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

More information about the R-sig-mixed-models mailing list