Last chance! 50% off unlimited learning
Sale ends in
bcPower(U, lambda, jacobian.adjusted = FALSE)yjPower(U, lambda, jacobian.adjusted = FALSE)
basicPower(U,lambda)
U
is a matrix or data frame, a vector of length
ncol(U)
of transformation parametersTRUE
, the transformation is normalized to have
Jacobian equal to one. The default is FALSE
.family="yeo.johnson"
then the Yeo-Johnson transformations are used.
This is the Box-Cox transformation of $U+1$ for nonnegative values,
and of $|U|+1$ with parameter $2-\lambda$ for $U$ negative. If jacobian.adjusted
is TRUE
, then the scaled transformations are divided by the
Jacobian, which is a function of the geometric mean of $U$.
The basic power transformation returns $U^{\lambda}$ if $\lambda$
is not zero, and $\log(\lambda)$ otherwise.
Missing values are permitted, and return NA
where ever U
is equal to NA
.
Yeo, In-Kwon and Johnson, Richard (2000) A new family of power transformations to improve normality or symmetry. Biometrika, 87, 954-959.
powerTransform
U <- c(NA, (-3:3))
bcPower(U, 0) # produces an error as U has negative values
bcPower(U+4,0)
bcPower(U+4, .5, jacobian.adjusted=TRUE)
yjPower(U, 0)
yjPower(U+3, .5, jacobian.adjusted=TRUE)
V <- matrix(1:10, ncol=2)
bcPower(V, c(0,1))
#basicPower(V, c(0,1))
Run the code above in your browser using DataLab