title: How to plot a rootogram for a quasipoisson model?
body: <p>I would like to plot a <code>rootogram</code> for a <code>quasipoisson</code> model. The countreg package works really well for poisson and for negative binomial but it says "family currently not supported" for quasipoisson models.</p>
  
  <p>I know that the packages <code>vcd</code> and <code>latticeExtra</code> can also plot rootograms. Unfortunately, when I try to plot a <code>rootogram</code> of a <code>quasipoisson</code> model with these packages I receive error messages.</p>
  
  <p>Here some code for all three packages:</p>
  
  <pre><code>#some data for replication)
  y &lt;- rpois(100, 3)
  x1 &lt;- c(rep(0, 50), rep(1, 50))
  x2 &lt;- rnorm(100, 1000, 300)
  data &lt;- data.frame(y, x1, x2)
  
  library(countreg)
  countreg::rootogram(glm(y~x1 +x2, data = data, family = quasipoisson))
  </code></pre>
  
  <h1>produces error:</h1>
  
  <blockquote>
    <p>Error in rootogram.glm(glm(y ~ x1 + x2, data = data, family = quasipoisson)) : 
      family currently not supported</p>
  </blockquote>
  
  <pre><code>library(vcd)
  vcd::rootogram(glm(y~x1 + x2, data = data, family = quasipoisson))
  </code></pre>
  
  <h1>produces error:</h1>
  
  <blockquote>
    <p>Error in rootogram.default(glm(y ~ x1 + x2, data = data, family = quasipoisson)) : 
      argument "fitted" is missing, with no default</p>
  </blockquote>
  
  <pre><code>library(latticeExtra)
  latticeExtra::rootogram(glm(y ~ x1 + x2, data = data, family = quasipoisson))
  </code></pre>
  
  <h1>produces error:</h1>
  
  <blockquote>
    <p>Error in sqrt(as.vector(object)) : 
      non-numeric argument to mathematical function</p>
  </blockquote>
  
  <p>In addition: Warning message:</p>
  
  <blockquote>
    <p>In rootogram.default(glm(y ~ x1 + x2, data = data, family = quasipoisson)) :
      NAs introduced by coercion</p>
  </blockquote>