mrgsolve
R/df_mrgsim_replicate.R
df_mrgsim_replicate.Rd
df_mrgsim_replicate()
is a wrapper function for mrgsolve::mrgsim_df()
that returns a data.frame containing replicates
iterations of data
Input dataset. Must contain required variables for mrgsim_df()
other than those handled by
other arguments.
mrgsolve
model object.
Number of replicates. Either an integer, or something coercible to an integer.
Names of actual and nominal time variables. Must be named character vector.
Defaults are "TIME"
and "NTIME"
.
Names of model outputs from model
. Must be named character vector.
Defaults are "PRED"
, "IPRED"
, and "DV"
. Currently both "IPRED"
and "DV"
are required in model@capture
.
Numeric variables in data
or simulation output to recover.
Must be a character vector of variable names from the simulation output to carry_out
and return in output. Defaults are "CMT"
, "EVID"
, "MDV"
, "NTIME"
.
Character variables in data
or simulation output to recover.
Must be a character vector of variable names from the simulation output to recover
and return in output.
Name of replicate variable in data
. Must be a string. Default is "SIM"
.
Random seed. Default is 123456789
.
Additional arguments passed to mrgsolve::mrgsim_df()
.
A data.frame with data
x replicates
rows (unless obsonly=TRUE
)
and the output variables in output_vars
, num_vars
, and char_vars
.
model <- model_mread_load(model = "model")
#> Loading model from cache.
simout <- df_mrgsim_replicate(data = data_sad, model = model, replicates = 100,
output_vars = c(DV = "ODV"),
num_vars = c("CMT", "LLOQ", "EVID", "MDV", "WTBL", "FOOD"),
char_vars = c("USUBJID", "PART"),
irep_name = "SIM")