This function is a helper for plotting functions where models in
an xpose_set can be averaged together. The implementation attempts
to match and extend from the cited prior work.
modavg_xpdb(
xpdb_s,
...,
.lineage = FALSE,
avg_cols = NULL,
avg_by_type = NULL,
algorithm = c("maa", "msa"),
weight_type = c("individual", "population"),
auto_backfill = FALSE,
weight_basis = c("ofv", "aic", "res"),
res_col = "RES",
quiet
)Weight-averaged <xpose_data> object.
<xpose_set> object
<tidyselect> of models in set. If empty, all models are
used in order of their position in the set. May also use a formula,
which will just be processed with all.vars().
<logical> where if TRUE, ... is processed
<tidyselect> columns in data to average
<character> Mainly for use in wrapper functions.
Column type to average, but resulting column names must be valid
for avg_cols (ie, same across all objects in the set). avg_cols will
be overwritten.
<character> Model selection or model averaging
<character> Individual-level averaging or by full dataset.
<logical> If true, <backfill_iofv> is automatically
applied.
<character> Weigh by OFV (default), AIC or residual.
<character> Column to weight by if "res" weight basis.
<logical> Minimize extra output.
Uster, D.W., Stocker, S.L., Carland, J.E., Brett, J., Marriott, D.J.E., Day, R.O. and Wicha, S.G. (2021), A Model Averaging/Selection Approach Improves the Predictive Performance of Model-Informed Precision Dosing: Vancomycin as a Case Study. Clin. Pharmacol. Ther., 109: 175-183. tools:::Rd_expr_doi("doi:10.1002/cpt.2065")
pheno_set %>%
modavg_xpdb(
avg_cols = IPRED,
auto_backfill = TRUE,
algorithm = "maa",
weight_basis = "aic"
)
Run the code above in your browser using DataLab