Title: | Generate Diagnostics for Pharmacometric Models Using 'shiny' |
Version: | 3.0.1 |
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. |
Depends: | R (≥ 4.0) |
License: | LGPL-3 |
URL: | https://certara.github.io/R-model-results/ |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.3.2 |
Suggests: | knitr, rmarkdown, testthat (≥ 3.0.0), Certara.RsNLME |
Imports: | colourpicker, shinyAce, shinymeta, Certara.Xpose.NLME, xpose, dplyr, flextable, shinyjqui, grDevices, ggplot2, plotly, magrittr, scales, shiny (≥ 1.7.0), shinyjs, shinyWidgets, shinyTree (≥ 0.3.1), sortable, tidyr, rlang, bslib (≥ 0.7.0) |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2025-02-27 23:19:17 UTC; jcraig |
Author: | James Craig [aut, cre], Shuhua Hu [ctb], Mike Talley [aut], Certara USA, Inc [cph, fnd] |
Maintainer: | James Craig <james.craig@certara.com> |
Repository: | CRAN |
Date/Publication: | 2025-03-03 11:50:24 UTC |
Get eps skrinkage values xpdb
Description
This function returns eps shrinkage values from xpdb object as a data.frame
.
Usage
get_eps_shk(xpdb)
Arguments
xpdb |
Object of class |
Value
Returns an object of class data.frame
.
Examples
get_eps_shk(xpdb_NLME$TwCpt_IVBolus_FOCE_ELS)
Get eta skrinkage values xpdb
Description
This function returns eta shrinkage values from xpdb object as a data.frame
.
Usage
get_eta_shk(xpdb)
Arguments
xpdb |
Object of class |
Value
Returns an object of class data.frame
.
Examples
get_eta_shk(xpdb_NLME$TwCpt_IVBolus_FOCE_ELS)
Generate and Report Model Diagnostics from NLME or NONMEM runs
Description
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.
Usage
resultsUI(model, xpdb = NULL, tagged = NULL, settings = NULL, ...)
Arguments
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. |
Value
If interactive()
, returns a list of tagged diagnostics from the Shiny application, otherwise returns TRUE
.
Examples
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.
Description
A ggplot2 theme for Certara.
Usage
theme_certara(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22,
grid = c("none", "horizontal", "both")
)
Arguments
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).
|
Details
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")
.
Value
An object of class theme()
.
Write code to R script from tagged diagnostics
Description
Use this function to write code to R script from diagnostics tagged in Certara's Model Results Shiny Application.
Usage
write_code(tagged, file)
Arguments
tagged |
List of tagged objects from returned from |
file |
Character specifying path of output file. If missing, it will be saved as |
Value
Returns NULL
after writing to file
.
Examples
if (interactive()) {
tagged_diagnostics <- resultsUI(xpdb = xpdb_NLME)
write_code(tagged_diagnostics, "tagged_results.R")
}
List of xpose data objects from RsNLME example tutorials
Description
The following object contains a list of 2 xpose_data
objects generated in the RsNLME example script
TwoCptIVBolus_FitBaseModel_CovariateSearch_VPC_BootStrapping.R
.
Usage
xpdb_NLME
Format
List of 2 xpose_data
objects constructed from NLME model output.
Details
-
xpdb_NLME$`TwCpt_IVBolus_FOCE-ELS`
is anxpose_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 anxpose_data
object created from the final model in the RsNLME example script. The final model includes selected covariateBodyWeight
added from the results of stepwise covariate search.
Source
Certara
List of xpose data objects from NONMEM model output
Description
The following object contains of list of 2 xpose_data
objects:
Usage
xpdb_NONMEM
Format
List of 2 xpose_data
objects constructed from NONMEM model output.
Details
-
xpdb_NONMEM$ex_pk
is anxpose_data
object fromxpose::xpdb_ex_pk
. The model contains multiple covariates and can be used to explore covariate model diagnostics. -
xpdb_NONMEM$mult_obs
is anxpose_data
object created from NONMEM model with multiple observed variables. Users will see that appropriate model diagnostic plots are automatically facetted byDVID
in the Shiny GUI.
Source
Certara