[R] erroneous additional weighting in plot.lm for glm objetcs?

Ulrich Halekoh Ulrich.Halekoh at agrsci.dk
Fri Feb 6 18:19:11 CET 2004


Hej,

In 'plot.lm' the deviance residuals
for a glm object are  
multiplied by the  square root of the objects weights
in the computation of the standardized deviance residuals.

But the deviance residuals contain already the 
square root of the prior weights as a factor.

Is the weighting in plot.lm for glm-objects erroneous and 
does it yield 
incorrect scale-location plots?


example:
Fitting a normal linear model for observations with
variances proportional to  w .
 
A glm-fit using weights=1/w
yields a scale-location plot which shows defects in the
variance model.

 w<-rep(c(1,25,100),rep(100,3))
 y<-rnorm(300)*sqrt(w)
 k<-glm(y~factor(w),weights=1/w)
 plot(k,which=3)

ulrich


==============================================================
Ulrich Halekoh,  PhD                         Phone: +45 8999 1825
Biometry Research Unit                       Fax:   +45 8999 1300
Danish Institute of Agricultural Sciences    E-mail: ulrich.halekoh at agrsci.dk
Research Centre Foulum, DK-8830 Tjele, Denmark




More information about the R-help mailing list