caret (version 5.07-005)

BoxCoxTrans.default: Box-Cox Transformations

Description

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.

See Also

boxcox, preProcess

Examples

Run this code
data(BloodBrain)

ratio <- exp(logBBB)
bc <- BoxCoxTrans(ratio)

bc

predict(bc, ratio[1:5])


ratio[5] <- NA
bc2 <- BoxCoxTrans(ratio, bbbDescr$tpsa, na.rm = TRUE)
bc2

Run the code above in your browser using DataLab