title: Calling predict after training with polr on multicollinear data problematic
body: <p>Take a look at the code below. This question has been asked before but shut down - presumably for lack of R code to reproduce the problem.</p>
  
  <p>Basically, when there is multicollinearity in the data, using Polr-trained model is problematic during the call to <code>predict()</code>. What am I missing here?</p>
  
  <p><strong>The part in bold below is what R says to me. The rest is my code.</strong></p>
  
  <pre><code>r = c(2,2,2,3,3,3,1,1,1,1)
  r = as.factor(r)
  x = c(0,0,0,4,5,6,0,-1,-1,1)
  y = c(5,5,2,1,0,3,10,4,3,8)
  z = c(0,0,0,4,5,6,0,-1,-1,1)
  a = data.frame(r,x,y,z)
  
  library(MASS)
  model &lt;- polr(r~x+z, data=a, Hess=TRUE)
  </code></pre>
  
  <blockquote>
    <p><strong>Warning message:
    In polr(r ~ x + z, data = a, Hess = TRUE) :
      design appears to be rank-deficient, so dropping some coefs</strong></p>
  </blockquote>
  
  <pre><code>test = model.frame(r~x+ z, data=a)
  predict(model, test, type="class", s=model$lambda.min)
  </code></pre>
  
  <blockquote>
    <p><strong>Error in X %*% object$coefficients : non-conformable arguments</strong></p>
  </blockquote>
  
  <pre><code>test2 = model.frame(r~x, data=a)
  predict(model, test2, type="class", s=model$lambda.min)
  </code></pre>
  
  <blockquote>
    <p><strong>Error in X %*% object$coefficients : non-conformable arguments</strong></p>
  </blockquote>
  
  <pre><code>test3 = model.frame(~x, data=a)
  predict(model, test2, type="class", s=model$lambda.min)
  </code></pre>
  
  <blockquote>
    <p><strong>Error in X %*% object$coefficients : non-conformable arguments</strong></p>
  </blockquote>
  
  <pre><code>model2 = polr(r~x, data=a, Hess=TRUE)
  predict(model2, test, type="class", s=model$lambda.min)
  </code></pre>
  
  <blockquote>
    <p><strong>[1] 1 1 1 3 3 3 1 1 1 2<br/>
        Levels: 1 2 3</strong></p>
  </blockquote>
  
  <pre><code>predict(model2, test2, type="class", s=model$lambda.min)
  </code></pre>
  
  <blockquote>
    <p><strong>[1] 1 1 1 3 3 3 1 1 1 2<br/>
        Levels: 1 2 3</strong></p>
  </blockquote>
  
  <pre><code>predict(model2, test3, type="class", s=model$lambda.min)
  </code></pre>
  
  <blockquote>
    <p><strong>[1] 1 1 1 3 3 3 1 1 1 2<br/>
        Levels: 1 2 3</strong></p>
  </blockquote>