title: Using modelr::add_predictions for glm
body: <p>I am trying to calculate the logistic regression prediction for a set of data using the tidyverse and modelr packages. Clearly I am doing something wrong in the <code>add_predictions</code> as I am not receiving the "response" of the logistic function as I would if I were using the 'predict' function in stats. This should be simple, but I can't figure it out and multiple searches yielded little.</p>
  
  <pre><code>library(tidyverse)
  library(modelr)
  options(na.action = na.warn)
  library(ISLR)
  
  d &lt;- as_tibble(ISLR::Default)
  model &lt;- glm(default ~ balance, data = d, family = binomial)
  grid &lt;- d %&gt;% data_grid(balance) %&gt;% add_predictions(model)
  
  ggplot(d, aes(x=balance)) + 
      geom_point(aes(y = default)) + 
      geom_line(data = grid, aes(y = pred))
  </code></pre>