[R] se from predict.glm

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Feb 17 19:50:29 CET 2000


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 type=
argument 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
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list