plot_dv_vs_predictions: Dependent variables vs Predictions plot

View source: R/plot_dv_vs_predictions.R

plot_dv_vs_predictionsR Documentation

Dependent variables vs Predictions plot

Description

Dependent variables vs Predictions plot

Usage

plot_dv_vs_predictions(
  run = NULL,
  compartment = NULL,
  dv = "DV",
  predictions = "PRED",
  log_dv = FALSE,
  facetted = TRUE,
  smoothing_method = NULL,
  smoothing_se = TRUE,
  identity_line = TRUE,
  x_scale = "linear",
  y_scale = "linear",
  logticks_annotation = TRUE,
  facet_scales = "free",
  transparency = FALSE,
  keep_time_zero = FALSE,
  auto_legend = TRUE
)

Arguments

run

pmxploit NONMEM run object.

compartment

integer. Number of the compartment of the dependent variable.

dv

character. Name of the dependent variable column in the output tables. Default is "DV".

predictions

character vector. Name of the predictions column(s) in the dataset. Default is "PRED" for both population predictions and individual predictions.

log_dv

logical. Set it to TRUE if the source dependent variable are in log_scale.

facetted

logical. If TRUE (default), plots each "DV vs predictions" subset inside a separate facet.

smoothing_method

character. ggplot2 smoothing method.

smoothing_se

logical. Display confidence interval around smooth?

identity_line

logical. Draws an identity line. Default is TRUE.

x_scale

character. X-axis scale, one of "linear" or "log". Default is "linear".

y_scale

character. Y-axis scale, one of "linear" or "log". Default is "linear".

logticks_annotation

logical. If x_scale and/or y_scale are "log", adds ticks annotation on the axis.

facet_scales

character. ggplot2 facet scales. Default is "free".

transparency

logical. Plot scatterplot dots with transparency, useful to avoid overplotting with large datasets. Default is FALSE.

keep_time_zero

logical. If TRUE, does not ignore values at initiation (when TIME = 0). Default is FALSE.

auto_legend

logical. When TRUE (default), default pmxploit plotting options are applied (title, labels, axis...).

split_by

character vector. Name of categorical covariates used to split the data.

Value

A ggplot2 object.

Examples


EXAMPLERUN %>%
  plot_dv_vs_predictions(compartment = 2, predictions = "PRED")

EXAMPLERUN %>%
  group_by(CMT) %>%
  plot_dv_vs_predictions(compartment = 2:3, predictions = "PRED")

EXAMPLERUN %>%
  plot_dv_vs_predictions(compartment = 2, predictions = "PRED", x_scale = "log", y_scale = "log")

EXAMPLERUN %>%
  plot_dv_vs_predictions(compartment = 2, predictions = "PRED", smoothing_method = "lm")
EXAMPLERUN %>%
  plot_dv_vs_predictions(compartment = 2, predictions = "PRED", smoothing_method = "loess")
EXAMPLERUN %>%
  plot_dv_vs_predictions(compartment = 2, predictions = "PRED", identity_line = FALSE)
EXAMPLERUN %>%
  plot_dv_vs_predictions(compartment = 2, predictions = "PRED", transparency = TRUE)

EXAMPLERUN %>%
  group_by(STUD) %>%
  plot_dv_vs_predictions(compartment = 2, predictions = "PRED")

pnolain/pmxploit documentation built on Jan. 31, 2024, 1:16 p.m.