title: Definition of rstandard (standardized residuals) with Poisson GLM in R
body: <p>I want to know how R finds standardized residuals or <code>rstandard</code> when fitting a poisson GLM. I have already found <a href="https://stackoverflow.com/questions/2531489/understanding-glmresiduals-and-residglm">this</a> but it is not talking about standardized residuals. So here is a simple code:</p>
  
  <pre><code>counts &lt;- c(18,17,15,20,10,20,25,13,12)
  x=rpois(9,1)
  E=counts*10+rpois(9,2)
  glm.D93 &lt;- glm(counts ~ x+offset(log(E)), family=poisson)
  </code></pre>
  
  <p>Now I need to know how R calculates:</p>
  
  <pre><code>&gt; rstandard(glm.D93)
             1            2            3            4            5            6 
   0.018364902 -0.009725560  0.011933387 -0.026455659 -0.036635623 -0.002118836 
             7            8            9 
   0.036552236 -0.022033897  0.034771135
  </code></pre>
  
  <p>I used help on <code>rstandard</code> to find that there are actually two types of  <code>rstandard</code>. One is based on "deviance" (default) and the other on based on "pearson" residuals. Both of these can be easily obtained by the following functions:</p>
  
  <pre><code>&gt; resid(glm.D93,type="dev")
  &gt; resid(glm.D93,type="pear")
  </code></pre>
  
  <p>I am guessing that to find <code>rstandard</code>, I should divide above two residuals by the standard deviation of the ith residual. Thanks.  </p>