Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_predictions() fails when outcome is log-transformed and named like a valid function #722

Open
mattansb opened this issue May 17, 2024 · 1 comment
Labels
bug 🐛 Something isn't working

Comments

@mattansb
Copy link
Member

library(performance)

mtcars$rt <- mtcars$mpg

these work…

model <- lm(log(mpg) ~ disp, data = mtcars)
check_predictions(model)

model <- lm(sqrt(rt) ~ disp, data = mtcars)
check_predictions(model)

model <- lm((rt) ~ disp, data = mtcars)
check_predictions(model)

these doens’t - why?

model <- lm(log(rt) ~ disp, data = mtcars)
check_predictions(model)
#> Error in exp(i) - plus_minus: non-numeric argument to binary operator

Created on 2024-05-17 with reprex v2.1.0

@mattansb mattansb changed the title check_predictions() fails when outcome is log-transformed and names "rt" check_predictions() fails when outcome is log-transformed and named like a valid function May 17, 2024
@mattansb
Copy link
Member Author

Okay, this happens if the outcome is named like any valid R function...

library(performance)

mtcars$lapply <- mtcars$mpg

model <- lm(log(lapply) ~ disp, data = mtcars)
check_predictions(model)
#> Error in exp(i) - plus_minus: non-numeric argument to binary operator


mtcars$binned_residuals <- mtcars$mpg

model <- lm(log(binned_residuals) ~ disp, data = mtcars)
check_predictions(model)
#> Error in exp(i) - plus_minus: non-numeric argument to binary operator

@mattansb mattansb added the bug 🐛 Something isn't working label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant