title: Plotting two curves with poisson glm with interactions in categorical variable
body: <p>I want to know if is possible to plotting two curves with poisson glm with interactions in categorical variables. In my case:</p>
  
  <pre><code>##Data set artificial
  set.seed(20)
  d &lt;- data.frame(
      behv = c(rpois(100,10),rpois(100,100)),
      mating=sort(rep(c("T1","T2"), 200)),
      condition = scale(rnorm(200,5))
  ) 
  
  #Binomial GLM ajusted
  model&lt;-glm(behv ~ mating + condition, data=d, family=poisson)
  summary(model)
  </code></pre>
  
  <p>In a situation where mating (categorical) and condition (numeric) are significant in the model</p>
  
  <pre><code>newdata &lt;- d
  newdata$condition &lt;- mean(d$condition)
  newdata$yhat &lt;- predict(model, newdata, type = "response")
  newdata &lt;- newdata[order(newdata$mating),]
  plot(newdata$behv~newdata$condition,ylab=c("behv"),
  xlab=c("condition"),xlim=c(-3,3))
  lines(x = newdata$mating, y = newdata$yhat)
  </code></pre>
  
  <p>Doesn't work and I've like a curve for T1 and other curve for T2 in mating variable and 
  changes is given by condition variable in the plot. I will try to use coefficients selection for each level of mating variable, but doesn't work too. Any ideas?</p>