I realize that, in regression analysis, if there is an interaction term included, it is recommended to center the variables (subtracting variable's mean).

My query is, should we

1) centering variable first, then create the interaction term,


2)create the interaction term first, then centering all variables including the interaction term?

these two operations can give different result, I am wondering which one is correct.

For example, we have 2 independent variables v1 & v2, and an interaction term v1 * v2,

let: v1 <- c(3, 5, 4, 2, 9) v2 <- c(1, 0, 1, 1, 0)

when creating the interaction term, I am confusing which one is correct:

method 1

v1*v2 - mean(v1*v2)
[1] 1.2 -1.8 2.2 0.2 -1.8


method 2

(v1-mean(v1)) * (v2-mean(v2))
[1] -0.64 -0.24 -0.24 -1.04 -2.64

  • 4
    $\begingroup$ Center the variables first, then take the interaction. There is lots of literature on this. The book I like is Aiken and West's Multiple Regression ... amazon.com/… $\endgroup$ – DJohnson Apr 6 '16 at 12:02
  • $\begingroup$ The main point is not to squander the limited number of digits that computers use to represent real numbers. $\endgroup$ – Scortchi Apr 6 '16 at 12:57
  • 2
    $\begingroup$ The other point is that then the main effect is an estimate for an average value of the covariate (instead of being for a value zero of the covariate, which in some cases may be a value that can never be observed). That may make it more interpretable. $\endgroup$ – Björn Apr 6 '16 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.