07 – Moderation & Mediation

Categorical Data Analysis (Soc 681) · Purdue University · Fall 2026

The lecture notes for this section of the course, with the Stata and R code and output for every example. This site contains all the material and code for the course. If you prefer the slides in PDF format and/or the Stata replication do-file, these can be downloaded at: lecture slides · replication code.

7.0 Moderation & Mediation

“… there will be a time when we must choose between what is easy and what is right”

  • The famous statistician Albus Dumbledore—presumably commenting on moderation and mediation in nonlinear models

Albus Dumbledore, an old wizard with a long white beard, from the Harry Potter films. Albus Dumbledore raising a finger as he speaks, beside lit candles.

Overview of topics

  1. Nonlinear interaction effects (AKA statistical moderation)
    • Best practices for testing interaction effects using predicted probabilities and marginal effects
      • Interaction effects can be classified based on the measurement level of the IVs involved in the interaction:
        1. Nominal X Continuous interactions
        2. Nominal X Nominal interactions
        3. Continuous X Continuous interactions
  2. Cross-model comparisons (e.g., mediation) and the problem of comparing effects across nonlinear models
    • Identification issues of coefficients
      • Model rescaling
      • Solutions to the rescaling problem
    • Comparisons of predicted probabilities and marginal effects

Contents

Back to top