title: Predicting binary response probabilities from gamlss R object
body: <p>I want to predict binary class probabilities/class labels from gamlss R function, how can the predict function be used to get them?</p>
  
  <p>I have the following sample code</p>
  
  <pre><code>library(gamlss)
  X1 &lt;- rnorm(500)
  X2 &lt;- sample(c("A","C","D","E"),500, replace = TRUE)
  Y &lt;- ifelse(X1&gt;0.2&amp; X2=="A",1,0)
  
  n &lt;- 500
  training &lt;- sample(1:n, 400)
  testing &lt;- (1:n)[-training]
  
  fit &lt;- gamlss(Y[training]~pcat(X2[training],Lp=1)+ri(X1[training],Lp=1),family=BI())
  
  pred &lt;- predict(fit,newdata = data.frame(X1,X2)[testing,],type = "response")
  </code></pre>
  
  <blockquote>
    <p>Error in predict.gamlss(fit, newdata = data.frame(X1, X2)[testing, ],  : 
       define the original data using the option data</p>
  </blockquote>
  
  <p>Any idea?</p>