Perform a exp(x) transformation
A vector to normalize with with x
If TRUE, the transformed values are also centered and scaled, such that the transformation attempts a standard normal
Should a warning result from infinite values?
additional arguments
an object of class 'exp_x'
a vector of data to be (potentially reverse) transformed
if TRUE, performs reverse transformation
A list of class exp_x
with elements
transformed original data
original data
mean after transformation but prior to standardization
sd after transformation but prior to standardization
number of nonmissing observations
Pearson's P / degrees of freedom
was the transformation standardized
The predict
function returns the numeric value of the transformation
performed on new data, and allows for the inverse transformation as well.
exp_x
performs a simple exponential transformation in the context of
bestNormalize, such that it creates a transformation that can be estimated
and applied to new data via the predict
function.
x <- rgamma(100, 1, 1)
exp_x_obj <- exp_x(x)
exp_x_obj
#> Standardized exp(x) Transformation with 100 nonmissing obs.:
#> Relevant statistics:
#> - mean (before standardization) = 10.70445
#> - sd (before standardization) = 41.39896
p <- predict(exp_x_obj)
x2 <- predict(exp_x_obj, newdata = p, inverse = TRUE)
all.equal(x2, x)
#> [1] TRUE