title: Conditional predicted probabilities using glm
body: <p>Simple question I can't figure out.  I am trying to generate conditional predicted probabilities from a model including an interaction.  For example, I wanted to be able to compare the predicted probability of when x2==1 and x3==0 with the predicted probability of when x2==0 and x3==1.</p>
  
  <p>I am trying to do this as follows:</p>
  
  <pre><code>model &lt;- glm(y~x1 + x2 * x3, family=binomial(link="logit"), data=data)
  predprob1 &lt;- predict(model, type="response", newdata=(x1=mean(x1) &amp; x2==1 &amp; x3==0))
  predprob2 &lt;- predict(model, type="response", newdata=(x1=mean(x1) &amp; x2==0 &amp; x3==1))
  probdiff&lt;-predprob1-predprob2
  </code></pre>
  
  <p>After that, I need to calculate the 95CI for probdiff. I am sure this is simple for you R geniuses out there. Thank you for your help!</p>