title: R: Predict (0,1) in logistic regression in glm()
body: <p>I am trying to model a "what if" situation in a binary logit model. I am estimating the probability of passing a test, given the level of difficulty of the test (1=easiest, 5=toughest), with gender as control. (The data is <a href="http://dl.dropbox.com/u/1791181/bayesglm.csv" rel="nofollow">here</a>). Students are administered a test which is generally tough ("HIGH" in the data). From this we can estimate the impact of test-difficulty on the likelihood of passing:</p>
  
  <pre><code>model = glm(PASS ~ as.factor(SEX) + as.factor(HIGH), family=binomial(link="logit"), data=df)
  summary(model)
  </code></pre>
  
  <p>We can also get the predicted probabilities of passing with:</p>
  
  <pre><code>predict.high = predict(model, type="response")
  </code></pre>
  
  <p>The question is, what if the "LOW" test were given instead? To get the new probabilities, we can do: </p>
  
  <pre><code>newdata = rename.vars(subset(df, select=c(-HIGH)), 'LOW','HIGH')
  predict.low = predict(model, newdata=newdata, type="response")
  </code></pre>
  
  <p>But how do I know how many additional students would have passed in this case? Is there an obvious switch in <code>glm()</code> I am not seeing?</p>