# identity, no transformation
model <- lm(Sepal.Length ~ Species, data = iris)
get_transformation(model)
# log-transformation
model <- lm(log(Sepal.Length) ~ Species, data = iris)
get_transformation(model)
# log-function
get_transformation(model)$transformation(0.3)
log(0.3)
# inverse function is exp()
get_transformation(model)$inverse(0.3)
exp(0.3)
# get transformations for all model terms
model <- lm(mpg ~ log(wt) + I(gear^2) + exp(am), data = mtcars)
get_transformation(model, include_all = TRUE)
Run the code above in your browser using DataLab