title: column names of ordered factor in model.matrix in R
body: <p>I created a design matrix using <code>model.matrix</code> function.</p>
  
  <p>If I use ordered factor data, I get <code>L</code>, <code>Q</code> and <code>C</code> suffixes in the column names. <strong><em>What do these suffixes mean and how are they mapped to factor levels?</em></strong> The help file for <code>model.matrix</code> is unclear on this question.</p>
  
  <pre><code>head( model.matrix( as.formula( ~ ps ), 
                      model.frame( as.formula( ~ ps ),
                                   data.frame(ps = factor( x =  sample(x = c( 'none', '3XLT', '41X',  '3X' ),
                                                                       size = 50,
                                                                       replace = TRUE ),
                                                           levels = c( '3X', '3XLT', '41X', 'none' ),
                                                           ordered = TRUE ) ) ) ) )
  
  #   (Intercept)       ps.L ps.Q       ps.C
  # 1           1 -0.2236068 -0.5  0.6708204
  # 2           1  0.6708204  0.5  0.2236068
  # 3           1  0.6708204  0.5  0.2236068
  # 4           1  0.2236068 -0.5 -0.6708204
  # 5           1  0.6708204  0.5  0.2236068
  # 6           1 -0.2236068 -0.5  0.6708204
  </code></pre>
  
  <p>If I use unordered factor, I can easily trace the mapping of the column by its column names.</p>
  
  <pre><code>head( model.matrix( as.formula( ~ ps ), 
                      model.frame( as.formula( ~ ps ),
                                   data.frame(ps = factor( x =  sample(x = c( 'none', '3XLT', '41X',  '3X' ),
                                                                       size = 50,
                                                                       replace = TRUE ),
                                                           levels = c( '3X', '3XLT', '41X', 'none' ) ) ) ) ) )
  
  #   (Intercept) ps3XLT ps41X psnone
  # 1           1      0     0      1
  # 2           1      1     0      0
  # 3           1      0     0      1
  # 4           1      1     0      0
  # 5           1      0     0      0
  # 6           1      1     0      0
  </code></pre>