title: How does R handle ordinal predictors in lm()?
body: <p>As I understand it, when you fit a linear model in R using a nominal predictor, R essentially uses dummy 1/0 variables for each level (except the reference level), and then giving a regular old coefficient for each of these variables. What does it do for <em>ordinal</em> predictors? It gives me estimated coefficients for each level, so it's not just treating the ranks as a numerical predictor. How do I properly interpret output like this?</p>
  
  <pre><code>cars.data &lt;- mtcars[,1:3]
  cars.data$cyl.ord &lt;- ordered(cars.data$cyl)
  lm(mpg ~ disp + cyl.ord, data = cars.data)
  </code></pre>
  
  <blockquote>
  <pre><code>Call:  
  lm(formula = mpg ~ disp + cyl.ord)  
  
  Coefficients:  
  (Intercept)         disp    cyl.ord.L    cyl.ord.Q  
     26.34212     -0.02731     -3.38852      1.95127 
  </code></pre>
  </blockquote>
  
  <p>I originally assumed that I could use the coefficients from the ordinal variable the same way I would if it were an unordered categorical, but <code>predict.lm(ord.model, newdata = data.frame("disp" = 150, "cyl.ord" = "6"))</code> gives 20.65263, while <code>26.34212378 -0.02730864*150 -3.38851642</code> gives only 18.85731, so that can't be it. (I tried +1.95127 and +0 in place of -3.38852 in case I was just mixed up about what order they were listed in, but no dice.) I couldn't find anything in the documentation for <code>order()</code> or <code>lm()</code>, online, or in any of my books.</p>
  
  <p>How does R deal with ordinal predictors mathematically, and how should I deal with the output?</p>