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, ...)
y
have to estimate the transformation?NA
values should be stripped from y
and x
before the computation proceeds.BoxCoxTrans
: options ot pass to boxcox
. plotit
should not be passed through. For predict.BoxCoxTrans
, additional arguments are ignored.BoxCoxTrans
BoxCoxTrans
returns a list of class BoxCoxTrans
with elementsfudge
summary(y)
max(y)/min(y)
predict.BoxCoxTrans
returns a numeric vector of transformed valuesboxcox
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.
boxcox
, preProcess
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