Skip to contents

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

Usage

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

Arguments

df

Data frame of model data.

model

An lme4 function that outputs a merMod object with that can be passed to merTools::predictInterval(). This should be one of lme4::lmer(), lme4::glmer(), or lme4::nlmer().

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.