Calculator
Example data table
This sample illustrates raw interaction terms (X×Z). Try pasting it into dataset mode.
| Row | X | Z | Raw interaction (X×Z) |
|---|---|---|---|
| 1 | 2 | 10 | 20 |
| 2 | 3 | 12 | 36 |
| 3 | 5 | 15 | 75 |
| 4 | 7 | 16 | 112 |
| 5 | 9 | 20 | 180 |
Formula used
How to use this calculator
- Choose two or three variables.
- Select single values or paste a dataset.
- Pick transformations, then choose a centering/scaling method.
- For dataset mode, keep Auto to derive centers/scales from data.
- Optionally enter coefficients to compute predicted values.
- Press Submit, then download CSV or PDF.
Interaction terms in applied modelling
Where interaction terms add value
Interaction terms capture cases where the effect of one variable changes with another. In a linear model, the product X×Z lets the slope on X vary as Z increases. For example, a one-unit rise in X can have a stronger impact when Z is high, and a weaker impact when Z is low. This calculator supports two-way and three-way products for moderation, synergy, and conditional sensitivity. It is useful when combined effects matter more than separate main effects in practice.
Raw, centered, and standardized construction
Raw products use X′=X and Z′=Z, so Interaction=X·Z. Mean-centering uses X′=X−cX and Z′=Z−cZ, which often reduces collinearity between main effects and the product term. Standardizing extends this with scaling: X′=(X−cX)/sX. In dataset mode, centers and scales can be derived from transformed data, keeping results aligned with common regression workflows.
Transformations and domain constraints
Transforms can improve linearity and stabilize variance before building products. Options include natural log, log10, square root, powers, and absolute value. Log transforms require positive inputs, while square roots require non-negative inputs; invalid rows are skipped and reported as notes. When you transform, interpret coefficients on the transformed scale, then consider centering so the reference point reflects an interpretable mean.
Batch processing and quality checks
Dataset mode accepts comma, tab, space, or semicolon separators and can process many rows in one run. The results table shows each original value alongside computed interactions, with configurable decimals from 0 to 12 places. Rows with missing or non-numeric cells are excluded, and the summary reports how many rows were used. This helps you prepare interaction columns for spreadsheets, scripts, or audit notes.
Prediction and export-ready reporting
When coefficients are provided, the calculator computes predicted values for each row using the selected adjusted variables and interaction terms. It also reports marginal effects at the adjusted means, helping explain how a slope changes with a moderator. CSV export produces a machine-readable file for further analysis, while PDF export produces a print-ready table for sharing. Together, these outputs support documentation from inputs through final interaction terms.
FAQs
1) What is an interaction term?
An interaction term is a product of variables, such as X×Z, used to model effects that change with another variable.
2) Should I center variables before multiplying?
Centering is often recommended because it reduces correlation between main effects and the product, improving numerical stability and interpretation.
3) When should I standardize instead of just centering?
Standardize when variables have very different units or scales and you want coefficients to be comparable across predictors.
4) Why are some rows skipped in dataset mode?
Rows are skipped when they contain missing or non-numeric values, or when a chosen transform makes a value invalid, such as log of a non-positive number.
5) Do I need coefficients to use the calculator?
No. Leave coefficients blank to compute interaction terms only; add coefficients only if you also want predicted values.
6) What is included in the CSV and PDF exports?
Exports include the input values and the computed interaction columns, plus predicted values when coefficients are provided.