Learn R Programming

DescTools (version 0.99.19)

LogLin: Log Linear Hybrid, Generalized Log

Description

Computes the log linear hybrid transformation, resp. generalized log, with the goal to stabilize the variance.

Usage

LogLin(x, a) LogGen(x, a)

Arguments

x
a numeric vector, matrix or data frame.

a
cutoff for the linear part of the transformation

Value

Details

The log linear hybrid transformation function is linear for x <= a="" and="" logarithmic="" for="" x=""> a. It is continuously differentiable. The generalized log and log-linear hybrid transformations were introduced in then context of gen-expression microarray data by Rocke and Durbin (2003).

The function LogLin is currently defined as:

function (x, a) {
  x[x<=a] 1="" <-="" x[x<="a]" a="" +="" log(a)="" -="" x[x="">a] <- log(x[x>a])
  return(x)
} 

and LogGen as:

function (x, a) {
 return(log((x + sqrt(x^2 + a^2)) / 2))
}

References

Rocke DM, Durbin B (2003): Approximate variance-stabilizing transformations for gene-expression microarray data, Bioinformatics. 22;19(8):966-72.

See Also

LogSt, log

Examples

Run this code
x <- seq(-10, 50, 0.1 )

plot(LogLin(x, a=5) ~ x, type="l")
grid()
lines(LogLin(x, a=2) ~ x, col="brown")
lines(LogLin(x, a=0.5) ~ x, col="steelblue")

lines(LogGen(x, a=1) ~ x, col="orange")

Run the code above in your browser using DataLab