Dear R users
Today I discovered that function lm.influence() stops when applied to
glm objects with the following error message

Error in if (NROW(e) != n) stop("non-NA residual length does not match
cases used in fitting") :
  argument is of length zero

After inspecting lm.influence.R (both into R-2.10.1.tar.gz and
R-patched.tar.gz) i found (line 53) that n is computed as
n <- as.integer(nrow(model$qr$qr))

However, glm objects (differently from lm objects) do not have a $qr
component. Is this intentional, i.e. it means that we have to use
lm.influence only with glm objects?
It could be, but I remark that the lm.influence{stats} help says:

The influence.measures() and other functions listed in See Also
provide a more user oriented way of computing a variety of regression
diagnostics. These all build on lm.influence. Note that for GLMs
(other than the Gaussian family with identity link) these are based on
one-step approximations which may be inadequate if a case has high
influence.

Moreover, if we have to use such a function only with lm objects, I
would suggest to implement some more explicit check.

Thanks in advance for any help

Fabrizio Cipollini

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to