title: Plotting fitted glm output using ggplot2 for interactions
body: <p>I am trying to plot my model output for two different models using <code>ggplot2</code>. When I visualize my plots they look exactly the same despite that they are fitted. </p>
  
  <p>The only difference between the two models is the addition of a variable "age" to the second model (and all two-way interactions that include "age").</p>
  
  <p>The first model is as follows:</p>
  
  <pre><code>ab_bi_f= glm(LRS_Bin ~ as.factor(DispersalFate) + MastN + as.factor(DispersalFate)*MastN, data = female, family = binomial(link = logit))
  </code></pre>
  
  <p>The second model is as follows:</p>
  
  <pre><code>rel_bi_f = glm(LRS_Bin ~ as.factor(DispersalFate) + Age + MastN + as.factor(DispersalFate)*MastN + Age*MastN +as.factor(DispersalFate)*Age, data = female, family = binomial(link = logit))
  </code></pre>
  
  <p>The code I use to fit and visualize the first models is:</p>
  
  <pre><code>fitted1&lt;- function (fit) {
      ggplot(data=fit$ab_bi_f, aes(x=MastN, y=LRS_Bin, colour=factor(DispersalFate))) + 
           stat_smooth() + 
           ggtitle("Binary absolute LRS model - female") + 
           labs(x="Total masts in female's lifespan", y="Mean fitted binary absolute LRS", colour="Dispersal type")+
           scale_x_continuous(breaks=c(0,1,2))+
           theme_classic()+annotate("text", x = 0, y = 0.89, label = "a",size=6)+
           coord_cartesian(ylim=c(0.1, 0.9))+
           scale_y_continuous(breaks=c(0.1,0.3,0.5,0.7,0.9))+
           scale_color_manual(values=c("#000000", "#999999"))+
           theme(legend.position=c(0.3,0.85),
           plot.title = element_text(size = 10),
           legend.title=element_text(size=10),
           axis.title=element_text(size=8), 
           legend.key = element_rect(size = 0.1),
           legend.key.size = unit(0.5, "cm"),
           legend.direction="horizontal")
  }
  plot1&lt;-fitted1(glm(MastN~LRS_Bin)) 
  </code></pre>
  
  <p>And, the code I used to visualize the second model is:</p>
  
  <pre><code>fitted2&lt;- function (fit) {
      ggplot(data=fit$rel_bi_f, aes(x=MastN, y=LRS_Bin, colour=factor(DispersalFate))) + 
           stat_smooth() + 
           ggtitle("Binary absolute LRS model - female") + 
           labs(x="Total masts in female's lifespan", y="Mean fitted binary absolute LRS", colour="Dispersal type")+
           scale_x_continuous(breaks=c(0,1,2))+
           theme_classic()+annotate("text", x = 0, y = 0.89, label = "a",size=6)+
           coord_cartesian(ylim=c(0.1, 0.9))+
           scale_y_continuous(breaks=c(0.1,0.3,0.5,0.7,0.9))+
           scale_color_manual(values=c("#000000", "#999999"))+
           theme(legend.position=c(0.3,0.85),
           plot.title = element_text(size = 10),
           legend.title=element_text(size=10),
           axis.title=element_text(size=8), 
           legend.key = element_rect(size = 0.1),
           legend.key.size = unit(0.5, "cm"),
           legend.direction="horizontal")
  }
  plot2&lt;-fitted2(glm(MastN~LRS_Bin)) 
  </code></pre>
  
  <p>This is the resulting plot:
  <a href="https://i.stack.imgur.com/OBZHZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OBZHZ.jpg" alt="enter image description here"></a></p>
  
  <p>The two plots look exactly the same! </p>
  
  <p>I can't figure out if I am making a mistake in my code or if the two models (despite the second model being different from the first) result in the same output... </p>
  
  <p>My data and code can be found <a href="https://figshare.com/s/ace5b44bc12394a7c46d" rel="nofollow noreferrer">here</a>.</p>