title: Probability predictions with cumulative link mixed models
body: <p>I am trying to fit cumulative link mixed models with the <code>ordinal</code> package but there is something I do not understand about obtaining the prediction probabilities. I use the following example from the <code>ordinal</code> package:</p>
  
  <pre><code>   library(ordinal)
  data(soup)
  ## More manageable data set:
  dat &lt;- subset(soup, as.numeric(as.character(RESP)) &lt;=  24)
  dat$RESP &lt;- dat$RESP[drop=TRUE]
  m1 &lt;- clmm2(SURENESS ~ PROD, random = RESP, data = dat, link="logistic",  Hess = TRUE,doFit=T)
  summary(m1)
  str(dat)
  </code></pre>
  
  <p>Now I am trying to get predictions of probabilities for a new dataset</p>
  
  <pre><code>newdata1=data.frame(PROD=factor(c("Ref", "Ref")), SURENESS=factor(c("6","6")))
  </code></pre>
  
  <p>with</p>
  
  <pre><code>predict(m1, newdata=newdata1)
  </code></pre>
  
  <p>but I am getting the following error</p>
  
  <pre><code>Error in `contrasts&lt;-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : 
    contrasts can be applied only to factors with 2 or more levels
  </code></pre>
  
  <p>Why am I getting this error? Is there something in the syntax of <code>predict.clmm2()</code> wrong? Generally which probabilities does does predict.clmm2() output? The <code>Pr(J&lt;j)</code> or <code>Pr(J=j)</code>? Could someone point me to information (site, books) material regarding fitting categorical (ordinal) ordinal mixed models specifically with R. From my search in the literature and net, most researchers fit these kind of models with SAS.</p>