Raincloud plots

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.width = 7, fig.height = 5
)
library(DUToolkit)

The probability densities of the highest (or lowest if the threshold is a minimum) projected outcome across simulation runs are plotted for each policy alternative alongside corresponding box plots, which indicate the mean and 50th percentile range. These plots are presented collectively on a single graph to facilitate visual comparison of the policy alternatives. The decision threshold is shown directly on the plot as a vertical line to provide a clear reference point for interpreting the outputs.

We use the plot_raincloud() function to generate the raincloud plots.

# define inputs
tmin <- min(psa_data$Intervention_1[, 1]) # minimum simulation time
tmax <- max(psa_data$Intervention_1[, 1]) # maximum simulation time
Dt_max <- TRUE # indicates the threshold values are maximums
D <- 750 # single threshold value for the peak

## find peak values
peak_values_list <- get_max_min_values(psa_data, tmin, tmax, Dt_max)

# generate raincloud plot
raincloud_plot <- plot_raincloud(peak_values_list, D)

raincloud_plot

Sharing outputs {#rain-outputs}

The raincloud plot can supplement the probability density plots by providing an intuitive and direct visual comparison of the severity of the situation at its expected peak for each policy alternative on a single plot.

We also recommend the following standard description for presenting the raincloud plots to decision-makers. We provide the standard description in paragraph and bullet point form for ease of use.

Standard description {.unnumbered}

::: rmdnote This graph shows the distribution of the [highest]{.underline}[^04-raincloud_plots-1] forecasted [outcome]{.underline}[^04-raincloud_plots-2] (i.e., the [peak]{.underline}[^04-raincloud_plots-3]) for each scenario alongside a corresponding box plot which indicates the mean and 50th percentile range. All interventions are displayed on a single graph to allow for visual comparison.

The red dashed line indicates the policy target. The more distribution area located to the [right]{.underline}[^04-raincloud_plots-4] of the policy target line, the greater the probability that the [outcome]{.underline}[^04-raincloud_plots-5] at its forecasted [peak]{.underline}[^04-raincloud_plots-6] will [surpass]{.underline}[^04-raincloud_plots-7] the policy target. :::

[^04-raincloud_plots-1]: if threshold is a minimum replace with lowest

[^04-raincloud_plots-2]: insert outcome description (ex. hospital demand)

[^04-raincloud_plots-3]: if threshold is a minimum replace with low point

[^04-raincloud_plots-4]: if threshold is a minimum replace with left

[^04-raincloud_plots-5]: insert outcome description (ex. hospital demand)

[^04-raincloud_plots-6]: if threshold is a minimum replace with low point

[^04-raincloud_plots-7]: if threshold is a minimum replace with fall below

Standard description bullet points {.unnumbered}

::: rmdnote This graph shows:

[^04-raincloud_plots-8]: if threshold is a minimum replace with lowest

[^04-raincloud_plots-9]: insert outcome description (ex. hospital demand)

[^04-raincloud_plots-10]: if threshold is a minimum replace with low point

[^04-raincloud_plots-11]: if threshold is a minimum replace with left

[^04-raincloud_plots-12]: insert outcome description (ex. hospital demand)

[^04-raincloud_plots-13]: if threshold is a minimum replace with low point

[^04-raincloud_plots-14]: if threshold is a minimum replace with fall below



Try the DUToolkit package in your browser

Any scripts or data that you put into this service are public.

DUToolkit documentation built on Sept. 14, 2025, 5:09 p.m.