df_mrgsim_addpred() is a wrapper function for
mrgsolve::mrgsim_df() and mrgsolve::zero_re() that returns
a data.frame with the addition of a new variable (PRED).
Arguments
- data
Input dataset.
- model
mrgsolvemodel object.- ipred_output
Name of the individual prediction output captured by
model. It is simulated with random effects zeroed (mrgsolve::zero_re()) and returned asPRED. Accepts bare names or strings. Default isIPRED.- ...
Additional arguments passed to
mrgsolve::mrgsim_df(). Acarry_outis merged withipred_output. Arguments that change the number of output rows (e.g.obsonly) are an error, sincePREDis matched todataby row.- output_var
See also
Other mrgsolve wrappers:
df_mrgsim_replicate(),
model_mread_load()
Examples
pkmodel <- model_mread_load(model = "pkmodel")
#> Loading model from cache.
data <- df_mrgsim_addpred(data = dplyr::filter(data_sad, CMT != 3), model = pkmodel)
