powtran
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.powtran(U, lambda,family,modified)
## S3 method for class 'default':
powtran(U, lambda,family="box.cox",modified=TRUE)
## S3 method for class 'bctrans':
powtran(U, lambda=coef(U), family=U$family,modified=FALSE)
## S3 method for class 'matrix':
powtran(U, lambda, family="power",modified=FALSE)
## S3 method for class 'data.frame':
powtran(U, lambda, family="power",modified=FALSE)
family="box.cox"
,
equals $(U^{\lambda}-1)/\lambda$
for $\lambda$ $\neq$ zero, and
$\log(U)$ if $\lambda =0$.
If family="yeo.johnson"
then the Yeo-Johnson transformations are used.
This is is Box-Cox transformation of $U+1$ for nonnegative values,
and of $|U|+1$ with parameter $2-\lambda$ for $U$ negative.
The basic power transformation is simply $U^{\lambda}$
if lambda not zero, and $\log(U)$ otherwise.
If modified=TRUE
, then the scaled transformations are divided by the
Jacobian, which is a function of the geometric mean.inv.tran.plot
, bctrans
,
inv.res.plot
,tran.family
.data(ufcwc)
attach(ufcwc)
powtran(Height,lambda=0)
inv.tran.plot(Dbh,Height, lam = c(-1, 0, 1), family="box.cox")
summary(ans <- bctrans1(cbind(Dbh,Height))) # bctrans1 is used for a matrix input
plot(ans)
Run the code above in your browser using DataLab