View source: R/get_bootSummaryNlme.R
| get_bootSummaryNlme | R Documentation |
Companion 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.
get_bootSummaryNlme(
bootResult,
xpdb = NULL,
transform = list(),
units = list(),
metric = c("Median", "Mean"),
ci_level = NULL,
return_code_ok = 1:3,
digits = 3
)
## S3 method for class 'bootSummaryNlme'
print(x, ...)
bootResult |
Object returned by |
xpdb |
Optional |
transform |
Named list of per-parameter transforms keyed by
parameter label. Same contract as |
units |
Named character vector (or list of length-1 character)
keyed by parameter label, overriding the real-units |
metric |
|
ci_level |
Numeric in (0, 1); width of the percentile CI. When
|
return_code_ok |
Integer vector of |
digits |
Significant-digits count applied via |
x |
A |
... |
Further arguments passed to the underlying tibble print method. |
Three input modes drive what columns appear in the output:
bootResult onlyNo original-fit source; output is
bootstrap-only – Section, Parameter, optional Unit,
Bootstrap estimate (<metric>), and Bootstrap <pct>% CI. A
message() notes that original-fit columns are unavailable and
how to include them (initialEstimates = TRUE or xpdb). The
residual-transform advisory (see below) still fires, since the
default's fitness can't be ruled out without PML either way.
bootResult carries an embedded fitSummaryfitSummary
is the original-fit source (when initialEstimates = TRUE was 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 a Diagonal column are treated as
diagonal-only.
xpdb argumentOriginal-fit columns come from
get_summaryNlme(xpdb, ...). If bootResult$fitSummary is also
non-NULL a one-shot warning fires and xpdb wins.
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.
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.
get_summaryNlme()
## Not run:
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%"
)
)
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.