title: Centering Variables in R
body: <p>Do centered variables have to stay in matrix form when using them in a regression equation?</p>
  
  <p>I have centered a few variables using the <code>scale</code> function with <code>center=T</code> and <code>scale=F</code>. I then converted those variables to a numeric variable, so that I can manipulate the data frame for other purposes. However, when I run an ANOVA, I get slightly different F values, just for that variable, all else is the same.</p>
  
  <p>Edit:</p>
  
  <p>What's the difference between these two:</p>
  
  <pre><code>scale(df$A, center=TRUE, scale=FALSE)  
  </code></pre>
  
  <p>Which will embed a matrix within your data.frame</p>
  
  <p>AND</p>
  
  <pre><code>scale(df$A, center=TRUE, scale=FALSE)
  df$A = as.numeric(df$A)
  </code></pre>
  
  <p>Which makes variable A numeric, and removes the matrix notation within the variable?</p>
  
  <p>Example of what I am trying to do, but the example doesn't cause the problem I am having:</p>
  
  <pre><code>library(car)
  library(MASS)
  mtcars$wt_c &lt;- scale(mtcars$wt, center=TRUE, scale=FALSE)
  mtcars$gear &lt;- as.factor(mtcars$gear)
  mtcars1     &lt;- as.data.frame(mtcars)
  # Part 1
  rlm.mpg   &lt;- rlm(mpg~wt_c+gear+wt_c*gear, data=mtcars1)
  anova.mpg &lt;- Anova(rlm.mpg, type="III")
  # Part 2
  # Make wt_c Numeric
  mtcars1$wt_c &lt;- as.numeric(mtcars1$wt_c)
  rlm.mpg2     &lt;- rlm(mpg~wt_c+gear+wt_c*gear, mtcars1)
  anova.mpg2   &lt;- Anova(rlm.mpg2, type="III")
  </code></pre>