Prediction with CI - predict.glm doesn't have interval option [closed]

I have a model and a graph:

n1 = glm(formula = cbind(ml, ad) ~ x1, family = "quasibinomial")


And I would like to plot a predicted line with a confidence interval. I would like to write this (as in predict.lm):

predict_n1s <- predict.glm(n1, data.frame(x1 = seq(..)), type = "response",
interval = c("confidence"))


But the interval option doesn't work for predict.glm! Is there any possibility how to call this?

If there is not, is this workaround OK?

n1_x <- seq(par("usr")[1], par("usr")[2], length.out = 200)
predict <- predict.glm(n1, data.frame(x1 = n1_x), type = "link", se.fit = TRUE)
lines(x = n1_x, y = n1$family$linkinv(predict$fit), col = "red") lines(x = n1_x, y = n1$family$linkinv(predict$fit + predict$se.fit * 1.96), col = "red", lty = 2) lines(x = n1_x, y = n1$family$linkinv(predict$fit - predict\$se.fit * 1.96), col = "red", lty = 2)

• Your workaround appears to be Wald-based confidence intervals, not prediction intervals. See mail 1 and mail 2 on the R-help list. – caracal Oct 26 '12 at 18:43
• I think we should use the binomial distribution instead of the normal one. – skan Oct 26 '15 at 11:06
• There are still CIs based on the coefficients alone. For a prediction interval, you'd need to do something with a quantile function. – jebyrnes Jan 26 '17 at 16:04