df_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
).
df_addpred(data, model, output_var = "IPRED", ...)
Input dataset.
mrgsolve
model object.
Name of output from model
to be captured as PRED
after removing random effects with mrgsolve::zero_re()
. Default is "IPRED"
.
Additional arguments passed to mrgsolve::mrgsim_df()
.
A data.frame with the same number of rows as data
and on additional
numeric variable PRED
.
model <- model_mread_load(model = "model")
#> Building model_cpp ...
#> done.
data <- df_addpred(data = data_sad, model = model)