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

odds_to_rr function doesn't work on interaction terms #102

Open
tomcardoso opened this issue Sep 30, 2020 · 0 comments
Open

odds_to_rr function doesn't work on interaction terms #102

tomcardoso opened this issue Sep 30, 2020 · 0 comments

Comments

@tomcardoso
Copy link

Hi there,

Thanks for making this great package. I'm running a logistic regression with an interaction term, and have come to realize that the odds_to_rr function throws an error if it's handling an interaction term. Here's what I get:

Waiting for profiling to be done...
Error in .subset2(x, i, exact = exact) : 
  attempt to select less than one element in get1index
Called from: (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else .subset2(x, 
    i, exact = exact))(x, ..., exact = exact)

Here's a simple snippet to reproduce:

test_model <- glm(vs ~ mpg + wt + mpg * wt, family = 'binomial', data = mtcars %>% mutate(vs = as.factor(vs)))
summary(test_model$fit)
odds_to_rr(test_model$fit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant