Title: | Generate Diagnostics for Pharmacometric Models Using 'shiny' |
---|---|
Description: | Utilize the 'shiny' interface to generate Goodness of Fit (GOF) plots and tables for Non-Linear Mixed Effects (NLME / NONMEM) pharmacometric models. From the interface, users can customize model diagnostics and generate the underlying R code to reproduce the diagnostic plots and tables outside of the 'shiny' session. Model diagnostics can be included in a 'rmarkdown' document and rendered to desired output format. |
Authors: | James Craig [aut, cre], Shuhua Hu [ctb], Mike Talley [aut], Certara USA, Inc [cph, fnd] |
Maintainer: | James Craig <[email protected]> |
License: | LGPL-3 |
Version: | 3.0.1 |
Built: | 2025-03-04 05:26:44 UTC |
Source: | https://github.com/cran/Certara.ModelResults |
This function returns eps shrinkage values from xpdb object as a data.frame
.
get_eps_shk(xpdb)
get_eps_shk(xpdb)
xpdb |
Object of class |
Returns an object of class data.frame
.
get_eps_shk(xpdb_NLME$TwCpt_IVBolus_FOCE_ELS)
get_eps_shk(xpdb_NLME$TwCpt_IVBolus_FOCE_ELS)
This function returns eta shrinkage values from xpdb object as a data.frame
.
get_eta_shk(xpdb)
get_eta_shk(xpdb)
xpdb |
Object of class |
Returns an object of class data.frame
.
get_eta_shk(xpdb_NLME$TwCpt_IVBolus_FOCE_ELS)
get_eta_shk(xpdb_NLME$TwCpt_IVBolus_FOCE_ELS)
Shiny application to generate, customize, and report diagnostic plots and tables from NLME or NONMEM output files. Create an Rmarkdown file of tagged model diagnostics and render into submission ready report.
resultsUI(model, xpdb = NULL, tagged = NULL, settings = NULL, ...)
resultsUI(model, xpdb = NULL, tagged = NULL, settings = NULL, ...)
model |
A single object, vector, or list of objects of class |
xpdb |
A single object or list of objects of class |
tagged |
List of tagged objects returned from previous |
settings |
List of settings (e.g., settings.Rds) returned from previous Shiny session. |
... |
Additional arguments for Pirana integration. |
If interactive()
, returns a list of tagged diagnostics from the Shiny application, otherwise returns TRUE
.
if (interactive()) { # RsNLME library(Certara.RsNLME) library(Certara.ModelResults) model1 <- pkmodel(numCompartments = 1, data = pkData, ID = "Subject", Time = "Act_Time", A1 = "Amount", CObs = "Conc", modelName = "OneCpt_IVBolus_FOCE-ELS") baseFitJob1 <- fitmodel(model1) model2 <- pkmodel(numCompartments = 2, data = pkData, ID = "Subject", Time = "Act_Time", A1 = "Amount", CObs = "Conc", modelName = "TwCpt_IVBolus_FOCE-ELS") baseFitJob2 <- fitmodel(model2) # Run Model Results resultsUI(model = c(model1, model2)) # NONMEM via xpose library(Certara.ModelResults) library(xpose) xpdb <- xpose_data( runno = "1", prefix = "run", ext = ".lst", dir = "./NONMEM/Hands_onB/") resultsUI(xpdb = xpdb) # Multiple models xpdb_multiple <- list( run1 = xpose_data(file = "run1.lst"), run2 = xpose_data(file = "run2.lst"), run3 = xpose_data(file = "run3.lst"), run4 = xpose_data(file = "run4.lst") ) }
if (interactive()) { # RsNLME library(Certara.RsNLME) library(Certara.ModelResults) model1 <- pkmodel(numCompartments = 1, data = pkData, ID = "Subject", Time = "Act_Time", A1 = "Amount", CObs = "Conc", modelName = "OneCpt_IVBolus_FOCE-ELS") baseFitJob1 <- fitmodel(model1) model2 <- pkmodel(numCompartments = 2, data = pkData, ID = "Subject", Time = "Act_Time", A1 = "Amount", CObs = "Conc", modelName = "TwCpt_IVBolus_FOCE-ELS") baseFitJob2 <- fitmodel(model2) # Run Model Results resultsUI(model = c(model1, model2)) # NONMEM via xpose library(Certara.ModelResults) library(xpose) xpdb <- xpose_data( runno = "1", prefix = "run", ext = ".lst", dir = "./NONMEM/Hands_onB/") resultsUI(xpdb = xpdb) # Multiple models xpdb_multiple <- list( run1 = xpose_data(file = "run1.lst"), run2 = xpose_data(file = "run2.lst"), run3 = xpose_data(file = "run3.lst"), run4 = xpose_data(file = "run4.lst") ) }
A ggplot2 theme for Certara.
theme_certara( base_size = 11, base_family = "", base_line_size = base_size/22, base_rect_size = base_size/22, grid = c("none", "horizontal", "both") )
theme_certara( base_size = 11, base_family = "", base_line_size = base_size/22, base_rect_size = base_size/22, grid = c("none", "horizontal", "both") )
base_size |
base font size, given in pts. |
base_family |
base font family |
base_line_size |
base size for line elements |
base_rect_size |
base size for rect elements |
grid |
Which grid lines should appear? Horizontal only, both horizontal and vertical, or none (default).
|
There are 3 variants of the theme: no grid
theme_certara()
, full grid theme_certara(grid = "both")
, and
horizontal grid lines only theme_certara(grid = "horizontal")
.
An object of class theme()
.
Use this function to write code to R script from diagnostics tagged in Certara's Model Results Shiny Application.
write_code(tagged, file)
write_code(tagged, file)
tagged |
List of tagged objects from returned from |
file |
Character specifying path of output file. If missing, it will be saved as |
Returns NULL
after writing to file
.
if (interactive()) { tagged_diagnostics <- resultsUI(xpdb = xpdb_NLME) write_code(tagged_diagnostics, "tagged_results.R") }
if (interactive()) { tagged_diagnostics <- resultsUI(xpdb = xpdb_NLME) write_code(tagged_diagnostics, "tagged_results.R") }
The following object contains a list of 2 xpose_data
objects generated in the RsNLME example script
TwoCptIVBolus_FitBaseModel_CovariateSearch_VPC_BootStrapping.R
.
xpdb_NLME
xpdb_NLME
List of 2 xpose_data
objects constructed from NLME model output.
xpdb_NLME$`TwCpt_IVBolus_FOCE-ELS`
is an xpose_data
object created from the base model in RsNLME example script.
The model can be used as a reference to compare model diagnostics in final model.
xpdb_NLME$`TwCpt_IVBolus_SelectedCovariateModel_FOCE-ELS`
is an xpose_data
object created from the final model
in the RsNLME example script. The final model includes selected covariate BodyWeight
added from the results of
stepwise covariate search.
Certara
The following object contains of list of 2 xpose_data
objects:
xpdb_NONMEM
xpdb_NONMEM
List of 2 xpose_data
objects constructed from NONMEM model output.
xpdb_NONMEM$ex_pk
is an xpose_data
object from xpose::xpdb_ex_pk
. The model contains multiple
covariates and can be used to explore covariate model diagnostics.
xpdb_NONMEM$mult_obs
is an xpose_data
object created from NONMEM model with multiple observed variables.
Users will see that appropriate model diagnostic plots are automatically facetted by DVID
in the Shiny GUI.
Certara