# Confusing about centering variables in regression analysis

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,

or

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

or

method 2

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

• 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/… – DJohnson Apr 6 '16 at 12:02
• The main point is not to squander the limited number of digits that computers use to represent real numbers. – Scortchi Apr 6 '16 at 12:57
• 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. – Björn Apr 6 '16 at 13:12