modglm: An R package for testing, interpreting, and displaying interactions in generalized linear models of discrete data
Many researchers hope to examine interaction effects using generalized linear models (GLMs) to predict outcomes on nonlinear scales. For instance, logistic and Poisson GLMs are used to estimate associations between predictors and outcomes in nonlinear probability and count scales, respectively. However, we (McCabe et al., 2021; Halvorson et al., in press) and others (Ai & Norton, 2003; Mize, 2019; Norton, Wang, & Ai, 2004) have shown that testing and interpreting interaction effects on these scales is not straightforward. GLMs require the application of partial derivatives and/or discrete differences to compute and probe interaction effects appropriately when models are interpreted on their nonlinear scale. Currently available open-source software does not provide methods of computing these interaction effects on probability and count scales, reflecting a central limitation in applying these methods in research practice. Here, we introduce `modglm`, an R-based software package that accompanies our manuscript providing recommendations for computing interaction effects in nonlinear probability and counts (McCabe et al., 2021). This software produces the interaction effect between two variables in generalized linear models of probabilities and counts and provides additional statistics and plotting utilities for evaluating and describing this effect.