MyNixOS website logo
Description

Plotting Two- and Three-Way Interactions.

Provides two- and three-way Johnson-Neyman-(Krause) plots for easier interpretation of interactions. It extends the classic framework of Johnson and Neyman (1936) and Johnson and Fay (1950) <doi:10.1007/BF02288864> to Bayesian models and three-way interactions. The functions have dedicated routines for classic lm()/glm() models, as well as 'lme4' models and 'RSiena' results. However, the package can also be used model agnostic and thus extends the availability of JN(K)-plots beyond what is currently available. A detailed introduction can be found in Krause (2026) <doi:10.48550/arXiv.2604.22051>.

int3ract

Visualizing 3-way interactions and obtaining regions of significance.

Interaction effects are ubiquitous in applied statistical modelling, yet their meaningful interpretation remains challenging. The classic Johnson-Neyman (JN) technique (Johnson and Neyman 1936) addresses this challenge for two-way interactions by identifying the regions of a moderator's range over which a focal effect is and is not statistically significant. The int3ract package for R implements the JN technique and its three-way extension (the Johnson-Neyman-Krause, or JNK, technique) for both frequentist and Bayesian models. The function JNK_freq() auto-detects models fitted via lm()/glm(), RSiena's siena(), or lme4's lmer()/glmer(), but can also be applied to multiplicative interactions from (virtually) any model family by supplying a coefficient vector and covariance matrix directly. For Bayesian Stochastic Actor-Oriented Models (SAOMs) estimated with multiSiena, or any model producing posterior draws, the function JNK_bayes() produces conditional posterior distributions. For two-way interactions, classic shaded confidence-band plots are created that visually demarcate significant and non-significant regions along the moderator range; three-way interactions yield colour-gradient heatmaps with optional crosshatch overlays for non-significant regions. The package is designed to encourage richer, region-specific reporting of interaction effects in place of the conventional single-slope spotlight approach.

Installation

# CRAN (once available):
install.packages("int3ract")

# Development version:
# install.packages("remotes")
remotes::install_github("RWKrause/int3ract")

Quick example

library(int3ract)

dat <- data.frame(y = rnorm(100), x = rnorm(100),
                  z = rnorm(100), w = rnorm(100))
res <- lm(y ~ x * z * w, dat)

# two-way JN plot
JNK_freq(res, theta_1 = "x", theta_2 = "z")$plots$z

# three-way JNK heatmap
JNK_freq(res, theta_1 = "x", theta_2 = "z", theta_3 = "w")$plots$z

Reference

Krause, R. W. (2026). int3ract: Johnson-Neyman Technique and its Three-Way Extension for Frequentist and Bayesian Models in R. arXiv:2604.22051. https://doi.org/10.48550/arXiv.2604.22051

Metadata

Version

1.0.7

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows