Hello,

silly question I suppose, but somehow I can't manage to extract the
probabilities from a glm.predict() result:

> str(res)
 Named num [1:9] 0.00814 0.01877 0.025 0.02941 0.03563 ...
 - attr(*, "names")= chr [1:9] "1" "2" "3" "4" ...

I got from:

# A Gamma example, from McCullagh & Nelder (1989, pp. 300-2)
clotting <- data.frame(
    u = c(5,10,15,20,30,40,60,80,100),
    lot1 = c(118,58,42,35,27,25,21,19,18),
    lot2 = c(69,35,26,21,18,16,13,12,12))
model <- glm(lot1 ~ log(u), data=clotting, family=Gamma)
res <- predict(model, clotting)

I want to transfer the probabilities "0.00814 0.01877 0.025 0.02941
0.03563 ..." to a separate vector, how do I do this?

______________________________________________
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