yeo_johnson: Yeo-Johnson Transform

View source: R/S05_Statistics.R

yeo_johnsonR Documentation

Yeo-Johnson Transform

Description

Transforms a numeric vector of values using the Yeo-Johnson (2000) power transformation family.

Usage

yeo_johnson(y, lambda)

Arguments

y

A numeric vector (values can be positive, negative, or zero).

lambda

A numeric value specifying the transformation to apply.

Value

A numeric vector.

References

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

Examples

# 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


rettopnivek/arfpam documentation built on Oct. 20, 2024, 7:24 p.m.