m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
AIC(m)
performance_aicc(m)
# correct AIC for models with transformed response variable
data("mtcars")
mtcars$mpg <- floor(mtcars$mpg)
model <- lm(log(mpg) ~ factor(cyl), mtcars)
# wrong AIC, not corrected for log-transformation
AIC(model)
# performance_aic() correctly detects transformed response and
# returns corrected AIC
performance_aic(model)
Run the code above in your browser using DataLab