Build a fused fit + bootstrap parameter summary
get_bootSummaryNlme.RdCompanion to get_summaryNlme() for
Certara.RsNLME::bootstrap() results. Combines original-fit columns
(Estimate, %RSE, Shrinkage (%)) with per-replicate bootstrap
columns (Bootstrap estimate (<metric>), Bootstrap <pct>% CI)
using the same transform / shrinkage machinery.
Arguments
- bootResult
Object returned by
Certara.RsNLME::bootstrap()(anrsnlme_bootlist of CSV-derived tables). Must carry at leastBootOverall(withReplicate+ReturnCodecolumns),BootThetaStacked, andBootOmegaStacked.- xpdb
Optional
xpose_dataobject fromxposeNlme()/xposeNlmeModel(). When supplied, used as the original-fit source.- transform
Named list of per-parameter transforms keyed by parameter label. Same contract as
get_summaryNlme()'stransformargument: either a preset string from the section's catalog or alist(fn = ..., dfn = ..., name = ...)spec, where the optionalnamesets the scale flag appended to the parameter name (a warning fires for a custom transform supplied withoutname). Applied to both the original-fit rows and the per-replicate bootstrap pool.- units
Named character vector (or list of length-1 character) keyed by parameter label, overriding the real-units
Unitcolumn for any row. Forwarded toget_summaryNlme()(m3) / the fitSummary pipeline (m2) and applied to the bootstrap-only output on m1. Keys not present in the relevant section emit a single warning and are ignored.- metric
"Median"(default) or"Mean"– statistic for theBootstrap estimate (<metric>)column.- ci_level
Numeric in (0, 1); width of the percentile CI. When
NULL(default) it inherits the bootstrap run'sconfidenceLevel(stored onbootResult), falling back to 0.95 when that metadata is absent. An explicit value always overrides.- return_code_ok
Integer vector of
ReturnCodevalues to accept; replicates outside this set are dropped. Defaults to1:3.- digits
Significant-digits count applied via
signif()to the bootstrap columns and, when an original-fit summary is present, to the stored numericEstimate,%RSE, andShrinkage (%). Defaults to 3. Theprint.bootSummaryNlmemethod also honoursdigitsfor displayed precision (by settingpillar.sigfigfor the duration of the print), so the original-fit columns show the same number of significant figures on screen as are stored – matching the pre-formatted bootstrap columns, which already carrydigitsin their character values.- x
A
bootSummaryNlmetibble returned byget_bootSummaryNlme().- ...
Further arguments passed to the underlying tibble print method.
Value
A tibble (class bootSummaryNlme) with Section, Parameter
(carrying a (CV%) / (SD) / custom scale flag when a non-identity
transform is active), optional original-fit columns (Estimate,
%RSE, Shrinkage (%)), an optional real-units Unit column, and
the two bootstrap columns (the CI formatted as "lo - hi"). Carries
the attributes n_used, n_total, ci_level, return_code_ok,
transform, metric, fitSource ("xpdb" / "embedded" /
"none"). The bootSummaryNlme class carries a print method that
honours the digits argument for displayed precision.
Details
Three input modes drive what columns appear in the output:
- m1:
bootResultonly No original-fit source; output is bootstrap-only –
Section,Parameter, optionalUnit,Bootstrap estimate (<metric>), andBootstrap <pct>% CI. Amessage()notes that original-fit columns are unavailable and how to include them (initialEstimates = TRUEorxpdb). The residual-transform advisory (see below) still fires, since the default's fitness can't be ruled out without PML either way.- m2:
bootResultcarries an embeddedfitSummary fitSummaryis the original-fit source (wheninitialEstimates = TRUEwas used on the bootstrap call). Omega off-diagonal covariance rows (Diagonal = FALSE) are dropped so the original-fit side stays variance-scale, matching m3's "off-diagonals excluded" contract; older fitSummary tables without aDiagonalcolumn are treated as diagonal-only.- m3: explicit
xpdbargument Original-fit columns come from
get_summaryNlme(xpdb, ...). IfbootResult$fitSummaryis also non-NULL a one-shot warning fires andxpdbwins.
Per-replicate filtering: replicates whose BootOverall$ReturnCode
falls outside return_code_ok are dropped silently before the metric
and percentile CI are computed. The BootOverall table on the
rsnlme_boot is the single source of truth – no on-disk reads.
The CI bounds are the empirical (1 - ci_level) / 2 and
1 - (1 - ci_level) / 2 quantiles of the kept replicates, computed
with stats::quantile()'s default method (type 7).
Soft-degrade for missing stacks: BootSigmaStacked and
BootSecondaryStacked are net-new in the corresponding
Certara.NLME8 release. When either is NULL (older NLME8 build) the
function emits NA bootstrap cells for that section and a single warning
naming the missing stacks plus the installed Certara.NLME8 version.
BootThetaStacked and BootOmegaStacked predate the new release and
are always available.
Output formatting (shared with get_summaryNlme()): when a
non-identity transform is active the values are shown on the
transformed scale only, and the scale label is appended to the shared
Parameter name in parentheses – nV (CV%), CEps (SD), or a custom
name for list(fn=, dfn=, name=) specs. Identity / raw rows keep
the bare name. The Unit column carries real units only and is
dropped when every row is dimensionless. The
bootstrap CI is a single character column formatted as "lo - hi" (a
dash range, no brackets). Numeric digits is applied via signif() to
both the bootstrap columns and, when present, the original-fit
Estimate, %RSE, and Shrinkage (%).
Residual-shape advisories: a per-sigma warning fires when PML
classifies a sigma as additive or otherwise non-proportional while it
is reported with the multiplicative_cv default. Classification
requires PML, which is only available when xpdb is supplied (m3); on
m1/m2 no per-sigma warning is emitted. The general default-transform
message() is broader: it fires for any defaulted sigma that isn't
proven proportional, which on m1/m2 (no PML to check) means it
always fires – mirroring get_summaryNlme()'s own no-PML behaviour.
Set options(xposeNlme.summary.quiet_default_warning = TRUE) to
silence it.
Examples
if (FALSE) { # \dontrun{
fit_boot <- Certara.RsNLME::bootstrap(model, ...)
# m1: bootstrap-only summary, no fit source.
get_bootSummaryNlme(fit_boot)
# m2: fused summary using the bootstrap's embedded fitSummary
# (initialEstimates = TRUE on the bootstrap call).
fit_boot_init <- Certara.RsNLME::bootstrap(model,
initialEstimates = TRUE, ...)
get_bootSummaryNlme(fit_boot_init)
# m3: fused summary against an explicit xpdb -- preferred when the
# xpdb has its own provenance (covariates, residuals, posthoc) that
# fitSummary doesn't capture.
xp <- xposeNlmeModel(fit_model)
get_bootSummaryNlme(fit_boot, xpdb = xp)
# Custom transform on a sigma applied to both original-fit and
# bootstrap columns; `name` sets the scale flag on the parameter name.
get_bootSummaryNlme(
fit_boot_init,
transform = list(
CEps = list(
fn = function(s) 200 * s,
dfn = function(s) 200,
name = "2xCV%"
)
)
)
} # }