# Box-Cox, Yeo-Johnson and Basic Power Transformations

### Description

Transform the elements of a vector using, the Box-Cox, Yeo-Johnson, or simple power transformations.

### Usage

1 2 3 4 5 |

### Arguments

`U` |
A vector, matrix or data.frame of values to be transformed |

`lambda` |
The one-dimensional transformation parameter, usually in
the range from |

`jacobian.adjusted` |
If |

`gamma` |
For bcPower or basicPower, the transformation is of U + gamma, where gamma is a positive number called a start that must be large enough so that U + gamma is strictly positive. |

### Details

The Box-Cox family of *scaled power transformations*
equals *(U^(lambda)-1)/lambda*
for *lambda not equal to zero*, and
*log(U)* if *lambda = 0*. If *gamma* is not specified, it is set equal to zero. `U + gamma`

must be strictly positive to use this family.

If `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. An alternative family to the Yeo-Johnson family is the `skewPower`

family that requires estimating both a power and an second parameter.

The basic power transformation returns *U^{λ}* if *λ*
is not zero, and *\log(λ)* otherwise.

If `jacobian.adjusted`

is `TRUE`

, then the scaled transformations are divided by the
Jacobian, which is a function of the geometric mean of *U* for skewPower and yjpower and of *U + gamma* for bcPower. With this adjustment, the Jacobian of the transformation is always equal to 1.

Missing values are permitted, and return `NA`

where ever `U`

is equal to `NA`

.

### Value

Returns a vector or matrix of transformed values.

### Author(s)

Sanford Weisberg, <sandy@umn.edu>

### References

Fox, J. and Weisberg, S. (2011)
*An R Companion to Applied Regression*, Second Edition, Sage.

Hawkins, D. and Weisberg, S. (2015) Combining the Box-Cox Power and Genralized Log Transformations to Accomodate Negative Responses, submitted for publication.

Weisberg, S. (2014) *Applied Linear Regression*, Fourth Edition, Wiley
Wiley, Chapter 7.

Yeo, In-Kwon and Johnson, Richard (2000) A new family of power
transformations to improve normality or symmetry. *Biometrika*, 87,
954-959.

### See Also

`powerTransform`

, `skewPower`

### Examples

1 2 3 4 5 6 7 8 9 |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.