BoxCoxTrans(y, ...)
expoTrans(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 'default':
expoTrans(y, na.rm = TRUE, init = 0,
lim = c(-4, 4), method = "Brent",
numUnique = 3, ...)
## S3 method for class 'BoxCoxTrans':
predict(object, newdata, ...)
## S3 method for class 'expoTrans':
predict(object, newdata, ...)
BoxCoxTrans, the data must be strictly positive.y have to estimate the transformation?NA values should be stripped from y and x before the computation proceeds.optim.BoxCoxTrans: options to pass to boxcox. plotit should not be passed through. For predict.BoxCoxTrans, additional arguments are ignored.BoxCoxTrans or expoTrans.BoxCoxTrans or expoTrans with elementsfudgesummary(y)max(y)/min(y)BoxCoxTrans also returns:fudgepredict functions returns numeric vectors of transformed valuesBoxCoxTrans 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. expoTrans estimates the exponential transformation of Manly (1976) but assumes a common mean for the data. The transformation parameter is estimated by directly maximizing the likelihood.
If any(y <= 0)<="" code=""> or if length(unique(y)) < numUnique, lambda is not estimated and no transformation is applied.=>
Manly, B. L. (1976) Exponential data transformations. The Statistician, 25, 37 - 42.
boxcox, preProcess, optimdata(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
manly <- expoTrans(ratio)
manlyRun the code above in your browser using DataLab