Description Usage Arguments Details Value Examples
do_prediction()
returns the predicted value for a set of predictors for a fitted model
1 | do_prediction(model_array, new_values = NA)
|
model_array |
a tibble retreived from the |
new_values |
a data frame or tibble contianing the values of each predictor to predict at. Defaults to the given dataset. |
Values are returned on the original scale of the outcome variable.
If a group was given in fit_model()
then a prediction is given for each group separately.
A tibble containing each predicted value along with which values were used for the prediction. Additional model information is returned including the type of distribution the model equation, and grouping information.
1 2 3 4 5 6 7 | trial_data <- tibble(w = runif(20, 0, 2), x = sample(c(1,2), 20, TRUE), y = rbinom(20, 15, .75))
new_data <- tibble(w = runif(5, 1, 2.5))
pois_model <- make_pois(w) %>% fit_model(frequentist, trial_data, y)
pois_model %>% do_prediction()
pois_model %>% do_prediction(new_data)
pois_model %>% do_prediction(new_data, 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.