f.log: Determine an optimized offset s and return log10(data+s).

Description Usage Arguments Value Note Author(s) Examples

Description

f.log determines a positive offset s for zero values to be used in a subsequent log transformation.

Usage

1
  f.log(x)

Arguments

x

vector of data.

Value

The transformed values log10(data + s).

Note

The value for the offset s is optimized to render the transformed values of x log-normal

Author(s)

W.Stahel, ETH Zuerich, werner.stahel@stat.math.ethz.ch adapted by: Christian W. Hoffmann <christian@echoffmann.ch>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  x <- c(rep(0,20), exp(rnorm(1000,0.05)))
  fx <- f.log(x)
 ## Not run: 
  oldpar <- par(mfrow = c(2, 3))
  plot(x,main="exp(normal)+zeros")
  qqnorm(x)
  T3plot(x)
  plot(fx,main="optimized offset")
  qqnorm(fx)
  T3plot(fx)
  par(oldpar)
 
## End(Not run)

cwhmisc documentation built on May 1, 2019, 7:55 p.m.