title: Classification accuracy of binomial glmer() predictions
body: <p>I've been busting my (non-r-savy) brains on a way to get R to produce the percentage of correct predictions for a binomial glmer model. I know this is not super informative statistically, but it is often reported; so I would like to report it as well.</p>
  
  <p>DATA:</p>
  
  <p>Dependent variable: Tipo, which has 2 values: 's' or 'p'. 
  Bunch of factor predictors, not a single continuous variable. 
  2 random intercepts: the test subject, and the nouns s/he responded to</p>
  
  <p>code used for the model:</p>
  
  <pre><code>model &lt;- glmer(Tipo ~ agency + tense + 
                 co2pr + pr2pr + socialclass + 
                 (1|muestra) + (1|nouns), 
                 data=datafile, family="binomial",
                 control=glmerControl(optimizer="bobyqa"), 
                 contrasts=c("sum", "poly"))
  </code></pre>
  
  <p>I know there is a function <code>predict()</code> which takes a model object and formulates predictions based upon that model, but I can't seem to make it work for me. I would appreciate if you would be willing to share the code. </p>
  
  <p>Thanks in advance.</p>