[R] Basic GLM: residuals definition

Martin Hoyle plxmh at nottingham.ac.uk
Wed Aug 27 18:00:50 CEST 2003


Dear R Users,

I suppose this is a school boy question, but here it is anyway. I'm trying to re-create the residuals for a poisson GLM with simulated data;

x<-rpois(1000,5)
model<-glm(x~1,poisson)
my.resids<-(log(x)- summary(model)$coefficients[1])
plot(my.resids,residuals(model))

This shows that my calculated residuals (my.resids) are not the same as residuals(model).
p 65 of Annette Dobson's book says that GLM (unstandardised) residuals are calculated by analogy with the Normal case.
So where am I going wrong?

Thanks for your attention.

Martin.


Martin Hoyle,
School of Life and Environmental Sciences,
University of Nottingham,
University Park,
Nottingham,
NG7 2RD,
UK
Webpage: http://myprofile.cos.com/martinhoyle




More information about the R-help mailing list