[Rd] Standardized Pearson residuals

From: Brett Presnell <presnell_at_stat.ufl.edu>
Date: Mon, 14 Mar 2011 17:25:21 -0400

Is there any reason that rstandard.glm doesn't have a "pearson" option? And if not, can it be added?

Background: I'm currently teaching an undergrad/grad-service course from Agresti's "Introduction to Categorical Data Analysis (2nd edn)" and deviance residuals are not used in the text. For now I'll just provide the students with a simple function to use, but I prefer to use R's native capabilities whenever possible.

I think something along the following lines should do it:

rstandard.glm <-
  function(model,

           infl=influence(model, do.coef=FALSE),
           type=c("deviance", "pearson"), ...)
{
  res <- switch(type, pearson = infl$pear.res, infl$dev.res)   res <- res/sqrt(1-infl$hat)
  res[is.infinite(res)] <- NaN
  res
}

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 14 Mar 2011 - 21:29:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Mar 2011 - 13:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive