
Plot a dose-proportionality assessment via power law (log-log) regression
Source:R/plot_doseprop.R
plot_doseprop.RdDual-mode wrapper that delegates to df_doseprop() for computation and
plot_build_doseprop() for rendering. Accepts either:
raw observation data (e.g. PKNCA output) plus a
metricsvector — the common one-shot mode; ora precomputed
doseprop_statsobject returned bydf_doseprop()— skip the regression refit and replot with differenttheme/sesettings.
On the precomputed path, pipeline arguments (metrics, metric_name_var,
metric_value_var, dose_var, method, ci, sigdigits) cannot be honored
because the regression does not run again — passing any of them aborts
with a message pointing the caller at df_doseprop(). Only theme and
se are accepted on both paths.
Usage
plot_doseprop(
data,
metrics = NULL,
metric_name_var = "PPTESTCD",
metric_value_var = "PPORRES",
dose_var = "DOSE",
method = "normal",
ci = 0.9,
sigdigits = 3,
se = TRUE,
theme = NULL
)Arguments
- data
Either raw observation data (data.frame, default expected format is output from
PKNCA::pk.nca()) or adoseprop_statsobject returned bydf_doseprop().- metrics
character vector of exposure metrics in
datato plot. Required on the raw-data path; ignored whendatais adoseprop_statsobject.- metric_name_var
Column in
datacontaining the metric names listed inmetrics. Accepts bare names or strings. Default isPPTESTCD.- metric_value_var
Column in
datacontaining the exposure metric values (dependent variable). Accepts bare names or strings. Default isPPORRES.- dose_var
Column in
datacontaining the dose (independent variable). Accepts bare names or strings. Default isDOSE.- method
character string specifying the distribution to be used to derive the confidence interval. Options are
"normal"(default) and"tdist".- ci
confidence interval to be calculated. Options
0.90(default) and0.95.- sigdigits
number of significant digits for rounding.
- se
logical to display confidence interval around regression. Default is
TRUE.- theme
Named list of aesthetic parameters for the plot created by
plot_doseprop_theme(). Defaults can be viewed by runningplot_doseprop_theme()with no arguments.
See also
Other dose proportionality:
df_doseprop(),
is_doseprop_stats(),
plot_build_doseprop(),
plot_doseprop_theme()
Examples
# Raw-data path
plot_doseprop(dplyr::filter(data_sad_nca, PART == "Part 1-SAD"),
metrics = c("aucinf.obs", "cmax"))
# Precomputed path: compute once, replot many times
stats <- df_doseprop(dplyr::filter(data_sad_nca, PART == "Part 1-SAD"),
metrics = c("aucinf.obs", "cmax"))
plot_doseprop(stats)
plot_doseprop(stats, se = FALSE)