dv_pred: Plot DV versus predicted values

View source: R/dv_pred.R

dv_predR Documentation

Plot DV versus predicted values

Description

Plots for DV versus population or individual predicted values. dv_preds makes both plots and returns them as a list (more in details).

Usage

dv_pred(
  df,
  x = pm_axis_pred(),
  y = pm_axis_dv(),
  yname = "value",
  xname = "value",
  ys = list(),
  xs = ys,
  loglog = FALSE,
  scales = c("fixed", "free", "null"),
  logbr = c("full", "half", "null"),
  ...
)

dv_ipred(df, x = pm_axis_ipred(), ...)

dv_preds(df, ...)

Arguments

df

data frame to plot

x

character name for x-axis data

y

character name for y-axis data

yname

used to form y-axis label

xname

used to form x-axis label

ys

see defy()

xs

see defx(); note that xs defaults to ys so (by default) the scale configuration will be identical; pass both xs and ys to have them independently configured

loglog

if TRUE, x- and y-axes will be log-transformed

scales

if TRUE, then the x- and y- axes will be forced to have the same limits

logbr

when using log scale, should the tick marks be at full-log intervals or half-log intervals? If you pass null, the default scales will be used (which might be identical to full). Use xs and ys to pass custom scales.

...

passed to scatt() and layer_as()

Details

Since this function creates a scatter plot, both the x and y columns must be numeric.

dv_preds returns a list of two plots, with the result of dv_pred in the first position and the result of dv_ipred in the second position. In this case, ... are passed to both functions.

Value

dv_pred and dv_ipred return a single plot; dv_preds returns a list of plots.

Examples

df <- pmplots_data_obs()

dv_pred(df)

dv_ipred(df, yname="MyDrug (ng/mL)")

dv_preds(df, yname = "MyDrug (ng/mL)")


metrumresearchgroup/pmplots documentation built on Feb. 13, 2025, 4:15 p.m.