View source: R/S05_Statistics.R
yeo_johnson | R Documentation |
Transforms a numeric vector of values using the Yeo-Johnson (2000) power transformation family.
yeo_johnson(y, lambda)
y |
A numeric vector (values can be positive, negative, or zero). |
lambda |
A numeric value specifying the transformation to apply. |
A numeric vector.
Yeo, I. K., & Johnson, R. A. (2000). A new family of power transformations to improve normality or symmetry. Biometrika, 87 (4), 954-959. https://doi.org/10.1093/biomet/87.4.954
# Example from page 958 of Yeo & Johnson (2000)
y <- c(
6.1, -8.4, 1.0, 2.0, 0.7, 2.9, 3.5,
5.1, 1.8, 3.6, 7.0, 3.0, 9.3, 7.5, -6.0
)
shapiro.test( y ) # Test of normality
y_transformed <- yeo_johnson(y, 1.305)
shapiro.test( y_transformed ) # Test of normality shows improvement
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.