[R] confidence bands for a quasipoisson glm

Peng, C cpeng.usm at gmail.com
Sat Sep 11 23:41:31 CEST 2010


Is this something you want to have  (based on a simulated dataset)?

counts <- c(18,17,15,20,10,20,25,13,12)
#risk <- round(rexp(9,0.5),3)
risk<- c(2.242, 0.113, 1.480, 0.913, 5.795, 0.170, 0.846, 5.240, 0.648)
gm <- glm(counts ~ risk, family=quasipoisson)
summary(gm)
new.risk=seq(min(risk), max(risk),0.1)
new.risk
y <- predict.glm(gm, newdata=data.frame(risk=new.risk), se.fit=TRUE,
type="response") 
upper=y$fit+1.96*y$se.fit
lower=y$fit-1.96*y$se.fit
plot(new.risk,y$fit, type="l", col=4, lty=1, lwd=2)
lines(new.risk, upper, type="l", col=2, lty=2, lwd=2)
lines(new.risk, lower, type="l", col=2, lty=2, lwd=2)



-- 
View this message in context: http://r.789695.n4.nabble.com/confidence-bands-for-a-quasipoisson-glm-tp2535883p2535952.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list