estimateTransform {car} | R Documentation |
Finding Univariate or Multivariate Power Transformations
Description
estimateTransform
computes members of families of transformations
indexed by one
parameter, the Box-Cox power family, or the Yeo and Johnson (2000) family, or
the
basic power family, interpreting zero power as logarithmic.
The family can be modified to have Jacobian one, or not, except for the basic
power family. Most users will use the function powerTransform
, which
is a front-end for this function.
Usage
estimateTransform(X, Y, weights=NULL, family="bcPower", start=NULL,
method="L-BFGS-B", ...)
Arguments
X |
A matrix or data.frame giving the “right-side variables”. |
Y |
A vector or matrix or data.frame giving the “left-side variables.” |
weights |
Weights as in |
family |
The transformation family to use. This is the quoted name of a
function for computing the transformed values. The default is
|
start |
Starting values for the computations. It is usually adequate to leave this at its default value of NULL. |
method |
The computing alogrithm used by |
... |
Additional arguments that are passed to the |
Details
See the documentation for the function powerTransform
.
Value
An object of class powerTransform
with components
value |
The value of the loglikelihood at the mle. |
counts |
See |
convergence |
See |
message |
See |
hessian |
The hessian matrix. |
start |
Starting values for the computations. |
lambda |
The ml estimate |
roundlam |
Convenient rounded values for the estimates. These rounded values will often be the desirable transformations. |
family |
The transformation family |
xqr |
QR decomposition of the predictor matrix. |
y |
The responses to be transformed |
x |
The predictors |
weights |
The weights if weighted least squares. |
Author(s)
Sanford Weisberg, <sandy@umn.edu>
References
Box, G. E. P. and Cox, D. R. (1964) An analysis of transformations. Journal of the Royal Statisistical Society, Series B. 26 211-46.
Cook, R. D. and Weisberg, S. (1999) Applied Regression Including Computing and Graphics. Wiley.
Fox, J. and Weisberg, S. (2011) An R Companion to Applied Regression, Second Edition, Sage.
Velilla, S. (1993) A note on the multivariate Box-Cox transformation to normality. Statistics and Probability Letters, 17, 259-263.
Weisberg, S. (2014) Applied Linear Regression, Fourth Edition, Wiley.
Yeo, I. and Johnson, R. (2000) A new family of power transformations to improve normality or symmetry. Biometrika, 87, 954-959.
See Also
powerTransform
, testTransform
,
optim
.
Examples
data(trees,package="MASS")
summary(out1 <- powerTransform(Volume~log(Height)+log(Girth),trees))
# multivariate transformation:
summary(out2 <- powerTransform(cbind(Volume,Height,Girth)~1,trees))
testTransform(out2,c(0,1,0))
# same transformations, but use lm objects
m1 <- lm(Volume~log(Height)+log(Girth),trees)
(out3 <- powerTransform(m1))
# update the lm model with the transformed response
update(m1,basicPower(out3$y,out3$roundlam)~.)