[R] se from predict.glm

Peter Dalgaard BSA
Thu, 17 Feb 2000 18:50:29 -0000

Chong Gu <chong at stat.purdue.edu> writes:

> Of course, knowing a bit about what's going on inside glm, I could use
> predict.lm to get what I want, but I am curious why se is not made
> available for the link prediction in predict.glm.

This was fixed recently (in 0.99.0). It happened because the typeargument got
passed on to predict.lm which doesn't know about
type=link. Newer versions of predict.glm has this kind of stuff
internally:

	pred <- predict.lm(object, newdata, se.fit, scale = residual.scale,
                           type=ifelse(type=="link",
"response",
                           type),
                           terms=terms)
        fit <- pred$fit
        se.fit <- pred$se.fit
        switch(type,
               response = {
                   fit <- family(object)$linkinv(fit)
                   se.fit <- se.fit * abs(family(object)$mu.eta(fit))
               },
               link =, terms=)



--
   O__  ---- Peter Dalgaard             Blegdamsvej 3
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907