0

I am considering using cat_plot in r to visualize interactions between two categorical variables.

However, do any of you know wheter it work on a poisson regression model?

e.g.:

model <- glm(event ~ sex * year + offset(log(PY)), family = poisson(link = "log"), data = data1)
0

1 Answer 1

0

Example data:

df <- data.frame(outcome = rpois(100, 6),
                 covar1 = as.factor(sample(1:4, 100, replace = TRUE)),
                 covar2 = as.factor(sample(LETTERS[1:2], 100, replace = TRUE)))

Example Model

model <- glm(outcome ~ covar1 * covar2, family = poisson(link = "log"), data = df)

Plot

interactions::cat_plot(model, pred = covar1, modx = covar2)

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.