Skip to contents

This function plots the tails probabilities of a marginal distribution.

Usage

plot_tails(data, var, xmin = NA, scale_d = 3, mult = 1, length_out = 10000)

Arguments

data

data.table::data.table A data.table containing the data to be plotted.

var

character The variable to be plotted. Must be a column of data.

xmin

numeric The minimum value of the variable to be plotted. Passed to kde1d::kde1d. Default is NA indicating no lower limit.

scale_d

numeric The scaling factor for the density plot between continuous and relative axis. Default is 3. Regulate the factor, if continuous density estimates and relative frequency are too distinct on the y-axis. Only used for zero inflated variables.

mult

numeric Bin width multiplier. Passed to kde1d::kde1d. Default is 1 indicating no multiplication.

length_out

numeric The length of the sequence to be used for the density plot. Default is 1e4.

Value

A ggplot that plots the continuous density estimate of the variable and the relative frequency of inflation.