[R] formula interaction and centering

A Dude dude_of_the_day at hotmail.com
Wed Oct 31 13:13:59 CET 2007

Dear readers,
I have a very basic question about the usage of the lm() function.
Sorry if I should have read this somewhere, but I was not able to find my answers in the accompanied documentation and r-project website.
Suppose I have an interaction term Num1 : Num2 somewhere in my formula, where both
Num1 and Num2 are numeric (not factors).
Should I now center Num1 and Num2 myself first, or is this done somewhere internally?
  Num1 <- Num1 - mean(Num1)
ps> I might be doing something strange. I analyzed different models, both containing a covariate (say, C1 and C2, which both are numeric),
and now I was trying to see what happens if I use a single model including both covariates. And there I arrived at the above situation where I was also experimenting with a model containing C1:C2 (could very well be i'm already breaking assumptions when there actually is any interaction between covariates, but i'm just trying several things as I'm quite a newbie in the world of statistics).
Thanks for your time,

More information about the R-help mailing list