jacob-long / jtools

Tools for summarizing/visualizing regressions and other helpful stuff
https://jtools.jacob-long.com
GNU General Public License v3.0
164 stars 22 forks source link

summ(scale=TRUE) breaks when transformation applied to outcome variable #101

Closed fredcallaway closed 2 years ago

fredcallaway commented 3 years ago

Potentially two bugs here (but likely related).

data <- data.frame(rt = exp(rnorm(10)), x=runif(10))
m <- lm(log(rt) ~ x, data=data)
summ(m)  # OK
summ(m, scale=TRUE)  # Error in log(rt) : non-numeric argument to mathematical function

m <- lm(x == 1 ~ rt, data=data)
summ(m)  # OK
summ(m, scale=TRUE)  # Error in eval(predvars, data, env) : object 'x' not found  
fredcallaway commented 2 years ago

Much thanks!