m <- glm(mpg ~ hp + wt, data = mtcars)
p0 <- coef(m)
# Predictions at fitted coefficients match predict.glm
all.equal(as.numeric(predict_glm(m)), fitted(m))
# Predictions with modified coefficients
predict_glm(m, p = p0 * 1.1)
Run the code above in your browser using DataLab