Combines bootstrap estimates with information in parameter key and performs some additional formatting.
define_boot_table(
.boot_estimates,
.key,
.ci = 95,
.na.rm = TRUE,
.nonboot_estimates = NULL
)
One of the following:
Output from bbr::bootstrap_estimates()
or a wide data frame denoting the
parameter estimates for each run. See details.
A file path to a csv containing the above dataset.
path to parameter key or data.frame of parameter key. Described
in more detail in param_key
the confidence interval. A value from 1 to 100 denoting the percent
confidence interval, or "iqr"
(interquartile range). Default is 95
.
logical (T/F). If TRUE
, any NA
and NaN
's are removed
before the quantiles are computed. Passed to stats::quantile()
.
Deprecated. Parameter estimates are now joined later in the workflow.
Below is the expected format of .boot_estimates
if a data frame is provided:
run THETA1 THETA2 THETA3 THETA4 THETA5 THETA6 THETA7 THETA8
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
001 0.494 4.19 1.20 4.20 1.24 0.488 -0.0615 0.377
002 0.405 4.07 1.14 4.23 1.32 0.536 -0.103 0.517
003 0.500 4.09 1.15 4.21 1.27 0.413 -0.0752 0.523
004 0.578 4.16 1.20 4.18 1.30 0.518 -0.0502 0.418
005 0.499 4.14 1.16 4.25 1.22 0.436 -0.0686 0.394
Notes:
Some parameter names may have punctuation (such as OMEGA(1,1)
). A new
name
column is automatically added that specifies the name without
punctuation (i.e. OMEGA11
).
Parameter details from the parameter key are joined to the bootstrap parameter
estimates. A dplyr::inner_join
is used so that only parameters in the model
output are kept in the table. This was done so that, if your base and final
model used the same structural THETAs and random parameters, the same
parameter key could be used for both.
This join adds the following columns: abb
(abbreviation), desc
(parameter description), panel
, trans
(transformation).
A final check is performed to determine whether parameters with special
transformation rules were defined correctly. In addition, a series of TRUE
/
FALSE
columns are added that will be used downstream.
model_dir <- system.file("model/nonmem", package = "pmparams")
paramKey <- file.path(model_dir, "pk-parameter-key-new.yaml")
# Using a file path:
boot_path <- file.path(model_dir, "boot/data/boot-106.csv")
define_boot_table(
.boot_estimates = boot_path,
.key = paramKey
)
#> # A tibble: 15 × 23
#> parameter_names lower value upper ci_level name abb desc panel
#> <chr> <dbl> <dbl> <dbl> <dbl> <chr> <chr> <chr> <chr>
#> 1 THETA1 1.39 1.57 1.78 95 THETA1 KA (1/h) Firs… stru…
#> 2 THETA2 58.3 61.5 65.1 95 THETA2 V2/F (L) Appa… stru…
#> 3 THETA3 3.07 3.23 3.42 95 THETA3 CL/F (L… Appa… stru…
#> 4 THETA4 65.0 67.3 69.8 95 THETA4 V3/F (L) Appa… stru…
#> 5 THETA5 3.37 3.61 3.86 95 THETA5 Q/F (L/… Appa… stru…
#> 6 THETA6 0.408 0.484 0.558 95 THETA6 CL/F ~ … eGFR… cov
#> 7 THETA7 -0.167 -0.0386 0.0878 95 THETA7 CL/F ~ … Age … cov
#> 8 THETA8 0.294 0.420 0.587 95 THETA8 CL/F ~ … Seru… cov
#> 9 OMEGA(1,1) 0.130 0.218 0.331 95 OMEGA11 IIV-KA Vari… IIV
#> 10 OMEGA(2,2) 0.0643 0.0821 0.101 95 OMEGA22 IIV-V2/F Vari… IIV
#> 11 OMEGA(3,3) 0.0896 0.112 0.140 95 OMEGA33 IIV-CL/F Vari… IIV
#> 12 OMEGA(2,1) 0.0328 0.0656 0.107 95 OMEGA21 V2/F-KA Cova… IIV
#> 13 OMEGA(3,1) 0.0805 0.121 0.173 95 OMEGA31 CL/F-KA Cova… IIV
#> 14 OMEGA(3,2) 0.0525 0.0696 0.0882 95 OMEGA32 CL/F-V2… Cova… IIV
#> 15 SIGMA(1,1) 0.0376 0.0400 0.0424 95 SIGMA11 Proport… Vari… RV
#> # ℹ 14 more variables: trans <chr>, transTHETA <lgl>, THETAERR <lgl>, TH <lgl>,
#> # OM <lgl>, S <lgl>, LOG <lgl>, LOGIT <lgl>, lognormO <lgl>, Osd <lgl>,
#> # logitOsd <lgl>, propErr <lgl>, addErr <lgl>, addErrLogDV <lgl>
# Using a `bbr` bootstrap model object:
if (FALSE) { # \dontrun{
boot_run <- bbr::read_model(file.path(model_dir, "106-boot"))
define_boot_table(
.boot_estimates = bbr::bootstrap_estimates(boot_run),
.key = paramKey
)
} # }