Skip to content

odds_to_rr function doesn't work on interaction terms #102

@tomcardoso

Description

@tomcardoso

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions