
Validates NONMEM estimation model with an mrgsolve simulation model
Source:R/model_validation.r
model_validation.RdThis function uses the estimates from a NONMEM run and compares this with the results of a simulation run. This function is inspired by a blog post from mrgsolve and mainly looks at the differences in population predictions
Usage
model_validation(
nmtable,
simmodel,
rounding = 4,
comppred = "CP",
out = "validate/result.tex",
...
)Arguments
- nmtable
either a character with a file or a data frame including the NONMEM table output
- simmodel
character with the file including the mrgsolve model
- rounding
numeric with the rounding applied for comparing
- comppred
character with the variable in mrgsolve model that should be compared with PRED variable in NONMEM
- out
character with the name of the output to create
- ...
additional arguments passed through to
mrgsimfunction
Details
For a correct comparison, the nmtable should include all variables related to dosing (e.g. AMT/CMT/EVID).
The simulation model should be available as a separate file that can be read in using mrgsolve::mread.
To use the function, the packages R3port, ggplot2, mrgsolve and dplyr should be installed.
Be aware that no variables are renamed in $TABLE in the NONMEM control stream (e.g. AMT2=AMT). This can have unexpected results when comparing.
Examples
if (FALSE) { # \dontrun{
res <- model_validation(system.file("testfiles/compareParfile",package="amp.sim"),
system.file("testfiles/compareModel.cpp",package="amp.sim"),
out=NULL)
} # }