Format bootstrap parameter estimate values and output selected columns to be shown in the bootstrap parameter table.
parameter estimates output from define_boot_table()
with
modifications ready for formatting
logical (T/F). Defaults to TRUE
, which selects the
following columns:
"abb"
, "desc"
, "boot_value"
, "boot_ci
".
Set to FALSE
to return all columns.
set significant digits for output (optional). Default is three digits
set maxex for computation (optional). Default is NULL
Deprecated. Please use .cleanup_cols
instead. Columns
to select for output. To return all columns, specify "all"
.
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")
boot_df <- define_boot_table(
.boot_estimates = boot_path,
.key = paramKey
)
format_boot_table(boot_df)
#> # A tibble: 15 × 4
#> abb desc boot_value boot_ci_95
#> <chr> <chr> <chr> <chr>
#> 1 KA (1/h) First order absorption rate constant 1.57 1.39, 1.78
#> 2 V2/F (L) Apparent central volume 61.5 58.3, 65.1
#> 3 CL/F (L/h) Apparent clearance 3.23 3.07, 3.42
#> 4 V3/F (L) Apparent peripheral volume 67.3 65.0, 69.8
#> 5 Q/F (L/h) Apparent intercompartmental clearance 3.61 3.37, 3.86
#> 6 CL/F ~ eGFR eGFR effect on CL/F 0.484 0.408, 0.558
#> 7 CL/F ~ Age Age effect on CL/F $-$0.0386 $-$0.167, 0.08…
#> 8 CL/F ~ ALB Serum albumin effect on CL/F 0.420 0.294, 0.587
#> 9 IIV-KA Variance of absorption 0.218 0.130, 0.331
#> 10 IIV-V2/F Variance of central volume 0.0821 0.0643, 0.101
#> 11 IIV-CL/F Variance of clearance 0.112 0.0896, 0.140
#> 12 V2/F-KA Covariance of V2/F - KA 0.0656 0.0328, 0.107
#> 13 CL/F-KA Covariance of CL/F - KA 0.121 0.0805, 0.173
#> 14 CL/F-V2/F Covariance of CL/F - V2/F 0.0696 0.0525, 0.0882
#> 15 Proportional Variance 0.0400 0.0376, 0.0424
# To include all columns:
format_boot_table(boot_df, .cleanup_cols = FALSE)
#> # A tibble: 15 × 25
#> 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
#> # ℹ 16 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>,
#> # boot_value <chr>, boot_ci_95 <chr>
# Using a `bbr` bootstrap model object:
if (FALSE) { # \dontrun{
boot_run <- bbr::read_model(file.path(model_dir, "106-boot"))
boot_df <- define_boot_table(
.boot_estimates = bbr::bootstrap_estimates(boot_run),
.key = paramKey
) %>% format_boot_table()
} # }