Interactions, slopes, and Johnson-Neyman plots #1178
-
Hi Vincent, Here's my deal. I've struggled with the inconsistency and complexity of ways of plotting things like interaction effects using R. It seems like your marginaleffects package could be a long-term solution! I waded into the online book, but found myself quickly unsure about the various options. I've been trying to wean myself off of Stata and keep my workflow in R, but the accessibility of the Stata resources for a user like me make it tempting to keep going back to Stata. Like this StataPress book gives step-by-step walk throughs of common interaction effects (e.g., categorical-by-continuous and categorical-by-categorical). Do you know if there's anything out there (or in the works) that gives similarly simple and detailed step-by-step walk-throughs of common (social science) interaction effect scenarios using marginaleffects all the way to the ggplot graphing? If there was, it'd probably really multiply the impact of your awesome package. I suspect there are a lot of users out there like me who could benefit from such simple step-by-step walk-throughs. Maybe it's on your website and I just missed it due to differences in terminology. I was just getting lost in all the options. Thanks if you have any ideas. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Tom, Glad you liked the talk! Currently, I believe that marginaleffects can do basically all that State's margins can do, and more. So it should be possible to replace. The good news: I just signed a contract with CRC press to write a book about this stuff. It will include a detailed chapter on interactions. The bad news: it's going to take a while to write and even more to publish. But I'll update the website periodically with new and re-written chapters. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the great multiplicative interactions vignette. The binary logistic regression interaction effect example has effects of interest that are nonlinear. I have a couple questions which may boil down to differences in terminology. Mize uses tests of second differences (whether two marginal effects are equal) to determine whether an interaction effect is significant for specific values of interest of the independent variables. In the case of a continuous predictor, it is recommended to include a graph with significance levels depicted at different values (Figure 14 in Mize). |
Beta Was this translation helpful? Give feedback.
Q1: yes, this is covered. Look for the use of the
hypothesis
argument.https://marginaleffects.com/vignettes/interactions.html
Q2: Figure 14 looks like what some people call a "Johnson-Neyman plot". FWIW, I would strongly advise against drawing such plots. In part because it reinforced and highlights the use of arbitrary thresholds of significance. But most importantly, as in the classics Gelman paper, "the difference between significant and not significant is not itself significant." http://www.stat.columbia.edu/~gelman/research/published/signif4.pdf
For these reasons, I have decided not to implement an option for Johson-Neyman plots highlighting significance.
But of course, you can draw…