The make.tran
function returns a
suitable list of functions for several popular transformations that are not
already provided elsewhere. 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 parameters,
specified as alpha
and beta
; in the following discussion,
we use \(\alpha\) and \(\beta\) to
denote alpha
and beta
, and \(y\) to denote the response variable.
The type
argument specifies the following transformations:
"genlog"
Generalized logarithmic transformation: \(\log_\beta(y +
\alpha)\), where \(y > -\alpha\).
When \(\beta = 0\) (the default), we use \(\log_e(y + \alpha)\)
"power"
Power transformation: \((y-\beta)^\alpha\), where \(y > \beta\).
When \(\alpha = 0\), \(\log(y-\beta)\) is used instead.
"boxcox"
The Box-Cox transformation (unscaled by the geometric
mean): \(((y - \beta)^\alpha - 1) / \alpha\), where \(y > \beta\).
When \(\alpha = 0\), \(\log(y - \beta)\)
is used.
"sympower"
A symmetrized power transformation on the whole real
line:
\(|y - \beta|^\alpha\cdot sign(y - \beta)\). There are no restrictions on \(y\), but we
require \(\alpha > 0\) in order for the transformation to be monotone and
continuous.
"asin.sqrt"
Arcsin-square-root transformation:
\(\sin^{-1}(y/\alpha)^{1/2}\). Typically, alpha
will be either 1 (default) or 100.
"atanh"
Arctanh transformation:
\(\tanh^{-1}(y/\alpha)\). Typically, alpha
will be either 1 (default) or 100.
"bcnPower"
Box-Cox with negatives allowed, as described for the
bcnPower
function in the car package. It is defined as the Box-Cox
transformation \((z^\alpha - 1) / \alpha\) of the variable \(z = y + (y^2+\beta^2)^{1/2}\).
Note that this requires both parameters and that beta > 0
.
"scale"
This one is a little different than the others, in that
alpha
and beta
are ignored; instead, they are determined by calling
scale(y, ...)
. The user should give as y
the response variable in the
model to be fitted to its scaled version.
Note that with the "power"
, "boxcox"
, or "sympower"
transformations,
the argument beta
specifies a location shift.
In the "genpower"
transformation, beta
specifies
the base of the logarithm -- however, quirkily, the default of beta = 0
is taken to be the natural logarithm. For example,
make.tran(0.5, 10)
sets up the \(\log_{10}(y + \frac12)\)
transformation. In the "bcnPower"
transformation, beta
must be specified as a positive value.
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\).