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)~.)
Run the code above in your browser using DataLab