do_prediction: Predict values from a fitted distribution

Description Usage Arguments Details Value Examples

Description

do_prediction() returns the predicted value for a set of predictors for a fitted model

Usage

1
do_prediction(model_array, new_values = NA)

Arguments

model_array

a tibble retreived from the fit_model() function

new_values

a data frame or tibble contianing the values of each predictor to predict at. Defaults to the given dataset.

Details

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.

Value

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.

Examples

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)

bprucka/uttr documentation built on May 27, 2019, 11:54 a.m.