title: Graph GLM in ggplot2 where x variable is categorical
body: <p>I need to graph the predicted probabilities of a logit regression in ggplot2. Essentially, I am trying to graph a glm by each treatment condition within the same graph. However, I am getting quite confused about how to do this seeing that my <code>treat</code> variable (i.e. the x I am interested in) is categorical.This means that when I try to graph the treatment effects using ggplot I just get a bunch of points at 0, 1, and 2 but no lines.</p>
  
  <p>My question is... How could I graph the logit prediction lines in this case? Thanks in advance!</p>
  
  <pre><code>set.seed(96)
  df &lt;- data.frame(
    vote = sample(0:1, 200, replace = T),
    treat = sample(0:3, 200, replace = T))
  
  glm_output &lt;- glm(vote ~ as.factor(treat), data = df, family = binomial(link = "logit"))
  
  predicted_vote &lt;- predict(glm_output, newdata = df, type = "link", interval = "confidence", se = TRUE)
  df &lt;- cbind(df, data.frame(predicted_vote))
  </code></pre>