heatmap_pvlrt: Heatmap, barplot and bubbleplot displaying likelihood ratio...

View source: R/pvlrt-plots.R

heatmap_pvlrtR Documentation

Heatmap, barplot and bubbleplot displaying likelihood ratio test results in a pvlrt object

Description

Heatmap, barplot and bubbleplot displaying likelihood ratio test results in a pvlrt object

Usage

heatmap_pvlrt(
  object,
  AE = NULL,
  Drug = NULL,
  grep = FALSE,
  fill_measure = "p_value",
  show_n = FALSE,
  show_lrstat = FALSE,
  show_p_value = FALSE,
  p_value_lower = 0,
  p_value_upper = 1,
  lrstat_lower = 0,
  lrstat_upper = Inf,
  n_lower = 0,
  n_upper = Inf,
  arrange_alphabetical = FALSE,
  remove_outside = FALSE,
  digits = 2,
  border_color = "black",
  fill_gradient_range = c("darkred", "white"),
  ...
)

## S3 method for class 'pvlrt'
barplot(
  height,
  AE = NULL,
  Drug = NULL,
  grep = FALSE,
  x_axis_measure = "lrstat",
  fill_measure = "p_value",
  show_n = FALSE,
  arrange_alphabetical = FALSE,
  show_p_value = FALSE,
  show_lrstat = FALSE,
  p_value_lower = 0,
  p_value_upper = 1,
  lrstat_lower = 0,
  lrstat_upper = Inf,
  n_lower = 0,
  n_upper = Inf,
  remove_outside = FALSE,
  digits = 2,
  Drug_nrow = 1,
  border_color = "black",
  x_axis_logscale = TRUE,
  fill_gradient_range = c("darkred", "white"),
  ...
)

bubbleplot_pvlrt(
  object,
  AE = NULL,
  Drug = NULL,
  grep = FALSE,
  x_axis_measure = "lrstat",
  fill_measure = "p_value",
  size_measure = "n",
  show_n = FALSE,
  arrange_alphabetical = FALSE,
  show_p_value = FALSE,
  show_lrstat = FALSE,
  p_value_lower = 0,
  p_value_upper = 1,
  lrstat_lower = 0,
  lrstat_upper = Inf,
  n_lower = 0,
  n_upper = Inf,
  remove_outside = FALSE,
  digits = 2,
  Drug_nrow = 1,
  border_color = "black",
  x_axis_logscale = TRUE,
  size_logscale = TRUE,
  fill_gradient_range = c("darkred", "white"),
  ...
)

Arguments

object, height

pvlrt object; output of pvlrt()

AE

input parameter determining which adverse events to show in the plot. This can be a numeric scalar specifying the number of top (in terms of computed LRT values) adverse events to show. Alternatively, it can be a character vector, specifying the exact adverse events to show. It can also be a vector of patterns to match (ignores cases) against the full names of all available adverse events, provided grep is set to TRUE. Defaults to adverse events corresponding to the top M pairs where M = max(number of possible pairs, 50). Set AE = Inf to force display of all adverse events.

Drug

input parameter determining which drugs to show in the plot. This can be a numeric scalar specifying the number of top (in terms of computed LRT values) drugs to show. Alternatively, it can be a character vector, specifying the exact drugs to show. It can also be a vector of patterns to match (ignores cases) against the full names of all available drugs, provided grep is set to TRUE. Defaults to drugs corresponding to the top M pairs where M = max(number of possible pairs, 50). Set Drug = Inf to force display all drugs.

grep

logical. Match patterns against the supplied AE or Drug names? Ignores if neither AE nor Drug is a character vector.

fill_measure

Measure to govern the filling color in each cell (in heatmap) or bar (in barplot) or circle/bubble (in bubbleplot) for each drug/AE combination. Defaults to "p_value". Available choices are: "p.value", "lrstat", and "n".

show_n

logical. show the sample size as inscribed text on each cell?

show_lrstat

logical. show the computed LRT statistic (on log-scale) inscribed text on each cell?

show_p_value

logical. show the computed p-value as inscribed text on each cell?

p_value_lower, p_value_upper

lower and upper limits on the computed p-values to display on the plot.

lrstat_lower, lrstat_upper

lower and upper limits on the computed LRT values to display on the plot.

n_lower, n_upper

lower and upper limits on the computed sample sizes to display on the plot.

arrange_alphabetical

logical. should the rows (AEs) and columns (Drugs) be arranged in alphabetical orders? Defaults to FALSE, in which case the orderings of the computed LRT values are used.

remove_outside

logical. Should the values for pairs with p-value, LRT statistics or sample sizes falling outside of the provided ranges through p_value_lower, p_value_upper etc., be replaced with NA? Defaults to FALSE. Setting this to TRUE may help distinguish drugs or AEs which has some pairs falling within and some pairs falling outside of the provided ranges better.

digits

numeric. Number of decimal places to show on the inscribed texts on the plot.

border_color

character string. Specifies the border color of cells/bars.

fill_gradient_range

character vector. Specifies the range of gradient colors used for fill_measure. Passed into the colours argument of scale_fill_gradientn from ggplot2.

...

Other arguments. Currently ignored

x_axis_measure

measure to show on the x-axis of the (horizontal) bar plots. Defaults to "lrstat" available choices are "lrstat", "p_value" and "n".

Drug_nrow

Number of rows in the panels for Drugs for the barplots.

x_axis_logscale

logical. Should the x axis measure in the bar plot or the bubble plot be log transformed (more precisely, "log1p" transformed with the function f(x) = log(1 + x))? Defaults to TRUE.

size_measure

measure to govern sizes of the circles in the bubble plot. Defaults to "n". Available choices are "lrstat", "p_value" and "n".

size_logscale

logical. Should the circle size measure in the the bubble plot be log transformed (more precisely, "log1p" transformed with the function f(x) = log(1 + x)). Defaults to TRUE.

Value

A ggplot object.

See Also

pvlrt

Examples

# 500 bootstrap iterations (nsim) in the example below
# are for quick demonstration only --
# we recommended setting nsim to 10000 (default) or bigger
test1 <- pvlrt(statin46, nsim = 500)
bubbleplot_pvlrt(test1)
heatmap_pvlrt(test1)
barplot(test1)



pvLRT documentation built on March 7, 2023, 7:17 p.m.