yeo_johnson | R Documentation |
Perform Yeo-Johnson transformation to attempt normalization.
yeo_johnson(x, lambda = NULL, eps = 0.001)
x |
a numeric vector of values to make normal. |
lambda |
the value of the lambda parameter. When NULL, an appropriate value is estimated from the data. |
eps |
the tolerance value under which lamba is considered to be 0 and that is used to choose the appropriate formula. |
The Yeo-Johnson is similar to the Box-Cox method, however it allows for the transformation of non-positive data as well.
A vector of transformed values, with an attribute to store the lambda value. The object if of class 'yeo_johnson' and can be used with predict.yeo_johnson()
.
Yeo, I. K., & Johnson, R. A. (2000). A new family of power transformations to improve normality or symmetry. Biometrika.
predict.yeo_johnson()
to apply the same transformation to a new dataset.
# simulate non-normal data
x <- rgamma(100, 1, 1)
hist(x)
# and make it more normal looking
hist(yeo_johnson(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.