Function that plots the median (or another quantile) of the posterior function with binary outcome along with the quanatile-based credible interval. The function is plotted on top of the binned input data. To bin the data, the score data is divided into bins of fixed length, then the average outcome in each bin is calculated. The average outcomes are plotted against the average values of the score in the corresponding bins.
plot_outcome_BIN(
LoTTA_posterior,
nbins = 100,
probs = c(0.025, 0.5, 0.975),
n_eval = 200,
col_line = "#E69F00",
size_line = 0.1,
alpha_interval = 0.35,
col_dots = "gray",
size_dots = 3,
alpha_dots = 0.6,
col_cutoff = "black",
title = "Outcome function",
subtitle = NULL,
y_lab = "",
x_lab = expression(paste(italic("x"), " - score")),
plot.theme = theme_classic(base_size = 14),
legend.position = "none",
name_legend = "Legend",
labels_legend = "median outcome fun.",
text = element_text(family = "serif"),
legend.text = element_text(size = 14),
plot.title = element_text(hjust = 0.5),
plot.subtitle = element_text(hjust = 0.5),
...
)
ggplot2 object
output of one of the LoTTA functions (LoTTA_sharp, LoTTA_fuzzy)
number of bins to aggregate the input data
list of three quantiles, the first and the last one define the quanatile-based credible interval, the middle value defines the quantile of the posterior function to plot; by default the quantiles correspond to the median posterior function and 95% credible interval probs=c(0.025,0.5,0.975)
n_eval*range(x) is the number of points at which each posterior function is evaluated, the higher number means slower computing time and a smoother plot; default n_eval=200
the color of the line and the band
thickness of the line
alpha value of the band, lower values correspond to a more transparent color
color of the dots that correspond to the binned data
size of the dots that correspond to the binned data
transparency of the dots that correspond to the binned data, lower values correspond to a more transparent color
color of the dotted line at the cutoff
title of the plot
subtitle of the plot
label of the y-axis
label of the x-axis
ggplot2 plot theme (see https://ggplot2.tidyverse.org/reference/ggtheme.html) possibly with additional arguments, it takes the default value plot.theme=theme_classic(base_size = 14),
position of the legend, refer to ggplot2 manual for the possible values; by default legend is not printed legend.position='none'
title of the legend
the label of the plotted function in the legend
can be any value that is accepted in the argument text in the theme function of ggplot2 package,refer to ggplot2 manual for the possible values; by default is changes font to a serif one text=element_text(family='serif')
can be any value that is accepted in the argument legend.text in the theme function of ggplot2 package,refer to ggplot2 manual for the possible values; by default is changes font size to the legend to 14 legend.text=element_text(size = 14)
can be any value that is accepted in the argument plot.title in the theme function of ggplot2 package,refer to ggplot2 manual for the possible values; by default it centers the plot title plot.title = element_text(hjust = 0.5)
can be any value that is accepted in the argument plot.subtitle in the theme function of ggplot2 package,refer to ggplot2 manual for the possible values; by default it centers the plot subtitle plot.title = element_text(hjust = 0.5)
other arguments of the theme function, refer to ggplot2 manual