View source: R/model_add_prediction.R
| add_prediction | R Documentation | 
Add model predictions and confidence bounds to a data frame.
add_prediction(data, ..., var = NULL, conf_int = FALSE, alpha = 0.1)
data | 
 a data frame of new data.  | 
... | 
 one or more objects of class   | 
var | 
 the name of the output column(s), defaults to NULL  | 
conf_int | 
 determines whether confidence intervals will be shown.
Defaults to   | 
alpha | 
 a real number between 0 and 1. Controls the confidence level of the interval estimates (defaults to 0.10, representing 90 percent confidence interval).  | 
data.frame
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.