Skip to contents

This is to be used in conjuncture with ds.predictLmer. The new data frame used for prediction may contain age or time values not present in the original data. This allows you to remove all predicted values beyond a minimum and maximum age. This ensures that plots only show predict values over a range where there was actually data.

Usage

dh.trimPredData(
  pred = NULL,
  coh_names = NULL,
  age = "age",
  min = NULL,
  max = NULL
)

Arguments

pred

Tibble of predicted values returned by dh.predictLmer.

coh_names

Character Vector of cohort names corresponding to cohorts included in pred.

age

Character specifying name of the age variable in pred.

min

Vector of minimum values of age with length equal to number of cohorts in pred.

max

Vector of maximum values of age with length equal to number of cohorts in pred.

Value

pred is returned as a tibble with predicted values outside of min and max removed.

See also

Other trajectory functions: dh.lmeMultPoly(), dh.makeAgePolys(), dh.makeLmerForm(), dh.predictLmer(), dh.zByGroup()