Similar to bestNormalize, this selects the best candidate constant for a log transformation on the basis of the Pearson P test statistic for normality. The transformation that has the lowest P (calculated on the transformed data) is selected. This function is currently in development and may not behave as expected.
See details for more information.
bestLogConstant(x, a, standardize = TRUE, ...)# S3 method for bestLogConstant
predict(object, newdata = NULL, inverse = FALSE, ...)
# S3 method for bestLogConstant
print(x, ...)
A list of class bestLogConstant
with elements
transformed original data
original data
Pearson's Pearson's P / degrees of freedom
out-of-sample or in-sample, number of folds + repeats
the chosen constant transformation (of class `log_x`)
the other transformations (of class `log_x`)
The predict
function returns the numeric value of the transformation
performed on new data, and allows for the inverse transformation as well.
A vector to normalize
(optional) a list of candidate constants to choose from
If TRUE, the transformed values are also centered and scaled, such that the transformation attempts a standard normal. This will not change the normality statistic.
additional arguments.
an object of class 'bestLogConstant'
a vector of data to be (reverse) transformed
if TRUE, performs reverse transformation
bestLogConstant
estimates the optimal normalizing constant
for a log transformation. This transformation can be performed on new data, and
inverted, via the predict
function.
bestNormalize
, log_x
,