This class can be used to estimate a Box-Cox transformation and apply it to existing and future data
Usage
BoxCoxTrans(y, ...)
## S3 method for class 'default':
BoxCoxTrans(y, x = rep(1, length(y)),
fudge = 0.2, numUnique = 3, na.rm = FALSE, ...)
## S3 method for class 'BoxCoxTrans':
predict(object, newdata, ...)
Arguments
Value
BoxCoxTrans returns a list of class BoxCoxTrans with elements
lambdaestimated transformation value
fudgevalue of fudge
nnumber of data points used to estimate lambda
summarythe results of summary(y)
ratiomax(y)/min(y)
skewnesssample skewness statistic
predict.BoxCoxTrans returns a numeric vector of transformed values
Details
This function is basically a wrapper for the boxcox function in the MASS library. It can be used to estimate the transformation and apply it to new data.
If any(y <= 0)<="" code=""> or if length(unique(y)) < numUnique, lambda is not estimated and no transformation is applied.=>
References
Box, G. E. P. and Cox, D. R. (1964) An analysis of transformations (with discussion). Journal of the Royal Statistical Society B, 26, 211-252.