From Achim.Zeileis at wu-wien.ac.at  Mon Jul 24 21:16:45 2006
From: Achim.Zeileis at wu-wien.ac.at (Achim Zeileis)
Date: Mon, 24 Jul 2006 21:16:45 +0200 (CEST)
Subject: [Rd] residuals.glm for glm(..., y = FALSE)
Message-ID: <Pine.LNX.4.58.0607242107230.17019@thorin.ci.tuwien.ac.at>

I just ran into a problem with residuals.glm() for GLMs fitted with
  glm(..., y = FALSE)
For such fits, the residuals of type "deviance", "pearson" and "response"
can't be computed (see example below). The reason is that residuals.glm()
uses
  y <- object$y
which obviously can't work for such fits.

I've checked ?glm and ?residuals.glm and did not find it mentioned
explicitely...looks like a bug to me.

Best,
Z

## example for poisson GLM from ?glm
  d.AD <- data.frame(treatment = gl(3,3), outcome = gl(3,1,9),
    counts = c(18,17,15,20,10,20,25,13,12))
  glm.D93 <- glm(counts ~ outcome + treatment, family = poisson,
    data = d.AD, y = FALSE)

## residuals cannot be computed
  residuals(glm.D93, type = "deviance")
  residuals(glm.D93, type = "pearson")
  residuals(glm.D93, type = "response")



[Rd] residuals.glm for glm(..., y = FALSE)
Achim Zeileis