predict_general_data: Generate prediction from model object

View source: R/predict_general_mdl.R

predict_general_dataR Documentation

Generate prediction from model object

Description

predict_general_data() generates a prediction vector from a model object and full data frame, putting this prediction back into the data frame.

Usage

predict_general_data(df, model, pred_col, pred_upper_col, pred_lower_col)

Arguments

df

Data frame of model data.

model

An R function that outputs a model object with a predict.model generic, where stats::family() contains an inverse link function linkinv and predict.model() accepts the se.fit = TRUE argument and returns confidence intervals. This includes stats::lm, stats::glm, and lme4::lmer.

pred_col

Column name to store predicted value.

pred_upper_col

Column name to store upper bound of confidence interval generated by the predict_... function. This stores the full set of generated values for the upper bound.

pred_lower_col

Column name to store lower bound of confidence interval generated by the predict_... function. This stores the full set of generated values for the lower bound.

Value

A data frame.


caldwellst/augury documentation built on Oct. 10, 2024, 8:20 a.m.