Finding Univariate or Multivariate Power Transformations
estimateTransform computes members of families of transformations
indexed by one
parameter, the Box-Cox power family, or the Yeo and Johnson (2000) family, or
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
is a front-end for this function.
estimateTransform(X, Y, weights=NULL, family="bcPower", start=NULL, method="L-BFGS-B", ...)
- A matrix or data.frame giving the
- A vector or matrix or data.frame giving the
- Weights as in
- The transformation family to use. This is the quoted name of a
function for computing the transformed values. The default is
bcPowerfor the Box-Cox power family and the most likely alternative is
yjPowerfor the Yeo-
- Starting values for the computations. It is usually adequate to leave this at its default value of NULL.
- The computing alogrithm used by
optimfor the maximization. The default
"L-BFGS-B"appears to work well.
- Additional arguments that are passed to the
optimfunction that does the maximization. Needed only if there are convergence problems.
See the documentation for the function
- An object of class
value The value of the loglikelihood at the mle. counts 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.
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. (2005) Applied Linear Regression, Third Edition. Wiley. Yeo, I. and Johnson, R. (2000) A new family of power transformations to improve normality or symmetry. Biometrika, 87, 954-959.
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)~.)