The functions lsmeans, ref.grid, and related ones automatically detect response transformations that are recognized by examining the model formula. These are log, log2, log10, sqrt, logit, probit, cauchit, cloglog; as well as (for a response variable y) asin(sqrt(y)), asinh(sqrt(y)), and sqrt(y) + sqrt(y+1). In addition, any constant multiple of these (e.g., 2*sqrt(y)) is auto-detected and appropriately scaled (see also the tran.mult argument in update.ref.grid).
A few additional character strings may be supplied as the tran argument in update.ref.grid: "identity", "1/mu^2", "inverse", "reciprocal", "asin.sqrt", and "asinh.sqrt".
More general transformations may be provided as a list of functions and supplied as the tran argument as documented in update.ref.grid. The make.tran function returns a suitable list of functions for several popular transformations. Besides being usable with update, the user may use this list as an enclosing environment in fitting the model itself, in which case the transformation is auto-detected when the special name linkfun (the transformation itself) is used as the response transformation in the call. See the examples below.
Most of the transformations available in "make.tran" require a parameter, specified in param; we use \(p\) to denote this parameter, and \(y\) to denote the response variable, in subsequent expressions.
The type argument specifies the following transformations:
"genlog"Generalized logarithmic transformation: \(log(y + p)\), where \(y > -p\)
"power"Power transformation: \(y^p\), where \(y > 0\). When \(p = 0\), "log" is used instead
"boxcox"The Box-Cox transformation (unscaled by the geometric mean): \((y^p - 1) / p\), where \(y > 0\). When \(p = 0\), \(log(y)\) is used.
"sympower"A symmetrized power transformation on the whole real line:
\(abs(y)^p * sign(y)\). There are no restrictions on \(y\), but we require \(p > 0\) in order for the transformation to be monotone and continuous.
"asin.sqrt"Arcsin-square-root transformation: \(sin^(-1)(y/p)^{1/2)}. Typically, the parameter \eqn{p} is equal to 1 for a fraction, or 100 for a percentage.\)
The user may include a second element in param to specify an alternative origin (other than zero) for the "power", "boxcox", or "sympower" transformations. For example, type = "power", param = c(1.5, 4) specifies the transformation (y - 4)^1.5.
In the "genpower" transformation, a second param element may be used to specify a base other than the default natural logarithm. For example, type = "genlog", param = c(.5, 10) specifies the log10(y + .5) transformation.For purposes of back-transformation, the sqrt(y) + sqrt(y+1) transformation is treated exactly the same way as 2*sqrt(y), because both are regarded as estimates of 2\sqrt\mu.