mod1 <- glm(nclaims ~ age_policyholder, data = MTPL,
offset = log(exposure), family = poisson())
mtpl_pred <- add_prediction(MTPL, mod1)
# Include confidence bounds
mtpl_pred_ci <- add_prediction(MTPL, mod1, conf_int = TRUE)
Run the code above in your browser using DataLab