Simple slopes and Johnson–Neyman calculator

Enter the coefficients and covariance from a regression with an X × W product term to get the simple slope of X at chosen values of W and the exact Johnson–Neyman values where it becomes significant.

No accountInstant resultsUses the covariance term

Enter the regression results

From a model Y = b₀ + b₁X + b₂W + b₃XW (+ covariates), as printed by your software.

COEFFICIENTS AND MODERATOR

LIVE RESULT

INSTANT

Simple slopes

Use the coefficients from the model that includes the product term, on the same scale as the moderator values you enter. If W was centred in the model, enter centred values.

Probing an interaction

A significant interaction between X and a moderator W says that the effect of X depends on W, but not where that effect is positive, negative or zero. Simple slopes answer this by computing the effect of X at chosen values of W, usually the mean and one standard deviation above and below. The Johnson–Neyman technique goes further and finds the exact values of W at which the effect of X becomes significant, so you do not depend on arbitrary cut points.

Simple slope of X at W = w: b₁ + b₃w
SE = √(var(b₁) + 2w cov(b₁, b₃) + w² var(b₃)), t = slope ÷ SE with the residual df
Johnson–Neyman bounds: the w solving (b₁ + b₃w)² = t²crit × SE(w)²

The covariance term matters. Leaving it out, as some quick calculators do, gives the wrong standard errors unless the moderator is centred and the covariance happens to be near zero. The calculator's slopes, standard errors and intervals match linear contrasts from an ordinary least squares fit in statsmodels, and the boundaries are where the slope's p-value equals α exactly.

Worked example

With the example coefficients, the interaction is b₃ = 0.125 (t(196) = 1.51, p = .132). The effect of X is 0.716 (p < .001) one SD below the mean of W, 0.960 at the mean and 1.204 one SD above. The Johnson–Neyman analysis shows that the slope of X is significant when W lies between 1.59 and 28.18. The upper bound is far beyond any observed W, so in practice the effect is significant for W above 1.59.

The example also shows how to read probing when the interaction itself is not significant: X has a clearly positive effect across the usual range of W, but the data cannot show that this effect changes with W. Report the interaction test first, and describe the simple slopes as estimates, not as evidence of moderation.

Reading the Johnson–Neyman result

  • Significant outside the bounds (the usual case with a strong interaction): X has a significant positive effect at one end of W and a significant negative or zero effect at the other, with a region in between where the slope is not distinguishable from zero.
  • Significant between the bounds: the slope is significant only for a middle range of W, often because the interaction itself is weak and the uncertainty grows at the extremes.
  • Only interpret bounds inside the observed range of W. A boundary at a value no participant had is an extrapolation.

Getting the inputs

  • R: coef(fit), sqrt(diag(vcov(fit))) and vcov(fit)["x", "x:w"]; residual df from df.residual(fit).
  • SPSS: tick “Covariance matrix” under Statistics in Linear Regression.
  • Stata: estat vce after regress.
  • Covariates can be in the model; they change b₁, b₃ and their covariance but not the method.

To check the incremental ΔR², F-change and Cohen’s f² of adding the interaction block first, use the hierarchical regression F-change calculator, or read the moderation and mediation reporting guide. To compare correlations between groups instead of probing a continuous moderator, use the compare correlations calculator. For mediation rather than moderation, see the Sobel test calculator.