Learn R Programming

alr3 (version 1.1.12)

tran.family.box.cox: Compute transformation families

Description

These are internal functions that compute families of transformations. The user accesses these functions using powtran.

Usage

## S3 method for class 'box.cox':
tran.family(U, lambda, modified = TRUE)
## S3 method for class 'yeo.johnson':
tran.family(U,lambda,modified=TRUE) 
## S3 method for class 'power':
tran.family(U,lambda,modified=FALSE)

Arguments

U
The variable to be transformed. Missing values are permitted. U must be strictly positive unless family="yeo.johnson".
lambda
The transformation parameter, typically a value between $-2$ and 2.
modified
TRUE to divide by the Jacobian, as need to transform the response, FALSE for no division.

Value

  • Returns a vector of the same length as U with the transformed values.

Details

Uses either the Box-Cox power family, the Yeo-Johnson generalization of this family for non-strictly-positive variables, or basic power transformations. You can add additional families by writing a function tran.family.myfamily with the same arguments as tran.family.box.cox, and then set family="myfamily" in the call to powtran. tran.family.YJ is an alias for tran.family.yeo.johnson. tran.family.boxcox is an alias for tran.family.box.cox. tran.family.basic is an alias for tran.family.power.

References

Weisberg, S. (2005). Applied Linear Regression, third edition. New York: 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

powtran.

Examples

Run this code
data(ufcwc)
attach(ufcwc)
powtran(Height,lambda=0)

Run the code above in your browser using DataLab