plot_continuous_covariates_distributions: Continuous covariates distributions

View source: R/plot_continuous_covariates_distributions.R

plot_continuous_covariates_distributionsR Documentation

Continuous covariates distributions

Description

Plots the distributions of the selected continuous covariates.

Usage

plot_continuous_covariates_distributions(
  run,
  covariates = NULL,
  baseline_only = TRUE,
  type = "histogram",
  histogram_bins = 30L,
  boxplot_facets = TRUE,
  boxplot_drop_unused = FALSE,
  qq_reference_distribution = qnorm,
  facet_scales = "free",
  overlay_splits = TRUE,
  auto_legend = TRUE
)

Arguments

run

pmxploit NONMEM run object.

covariates

character vector of continous covariates names. Default is NULL, returning all continuous covariates.

baseline_only

logical. Consider only the baseline (= first) values of the subjects. Default is TRUE.

type

character. Type of distribution representation. One of histogram, density, boxplot and qq (Q-Q plot of the Normal distribution). Default is histogram.

histogram_bins

integer. If type = "histogram", sets the number of bins. Default is 30.

boxplot_facets

logical. If type = "boxplot", represent boxplots in different facets when TRUE.

boxplot_drop_unused

logical. If type = "boxplot", drops unused factor levels when TRUE.

facet_scales

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

overlay_splits

logical. If splitting is applied, TRUE will overlay splits on a same graph while FALSE will plot them on different facets. Default is TRUE.

auto_legend

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

split_by

character vector. Names of categorical covariates used to split the distributions.

Value

A ggplot2 object.

Examples

EXAMPLERUN %>% plot_continuous_covariates_distributions()
EXAMPLERUN %>% plot_continuous_covariates_distributions(type = "density")
EXAMPLERUN %>% plot_continuous_covariates_distributions(type = "boxplot")
EXAMPLERUN %>% plot_continuous_covariates_distributions(type = "qq")

EXAMPLERUN %>%
  group_by(SEX) %>%
  plot_continuous_covariates_distributions(type = "boxplot", covariates = c("AGE", "WT"))

EXAMPLERUN %>%
  group_by(SEX, STATIN) %>%
  plot_continuous_covariates_distributions(type = "boxplot", covariates = c("AGE", "WT"))

EXAMPLERUN %>%
  group_by(SEX) %>%
  plot_continuous_covariates_distributions(type = "histogram", covariates = c("AGE", "WT"))

EXAMPLERUN %>%
  group_by(SEX) %>%
  plot_continuous_covariates_distributions(type = "histogram",
                                           covariates = c("AGE", "WT"),
                                           overlay_splits = FALSE)

EXAMPLERUN %>%
  group_by(SEX) %>%
  plot_continuous_covariates_distributions(type = "density")

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