# identity, no transformation
model <- lm(Sepal.Length ~ Species, data = iris)
find_transformation(model)
# log-transformation
model <- lm(log(Sepal.Length) ~ Species, data = iris)
find_transformation(model)
# log+2
model <- lm(log(Sepal.Length + 2) ~ Species, data = iris)
find_transformation(model)
# find transformation for all model terms
model <- lm(mpg ~ log(wt) + I(gear^2) + exp(am), data = mtcars)
find_transformation(model, include_all = TRUE)
# inverse, response provided as character string
find_transformation("1 / y")
Run the code above in your browser using DataLab