Visualize Draws from Prior or Posterior Distributions
vizdraws(
prior = NULL,
posterior = NULL,
MME = 0,
threshold = NULL,
units = NULL,
quantity = FALSE,
tense = c("future", "past"),
backgroundColor = "#FFFFFF",
backgroundOpacity = 0.9,
xlab = NULL,
breaks = NULL,
break_names = NULL,
colors = NULL,
width = NULL,
height = NULL,
xlim = NULL,
font_scale = 1,
display_mode_name = FALSE,
title = "",
stop_trans = FALSE,
percentage = FALSE,
elementId = NULL,
logoPath = NULL,
logoSize = 100,
logoLocation = c("bottom-right", "top-left", "top-right", "bottom-left")
)
(optional) Prior distribution or draws from it. Supported distributions: `Normal`, `uniform`, `beta`, and `gamma`. Provide either this or the posterior.
(optional) Draws from the posterior distribution. Provide either this or the prior.
Minimum meaningful effect. If not provided, MME is set to zero.
If the probability is greater than this threshold, a decision is considered comfortable.
Optional argument to specify the units of x (e.g., dollars or applications).
Defaults to FALSE
. When set to true, the text will reflect predicting a quantity rather than a treatment effect.
Either "future" or "past." This is the tense used in the description if quantity is set to TRUE. NULL
.
Defaults to '#FFFFFF'
.
Defaults to 0.9
.
Defaults to NULL
.
Defaults to NULL
.
Defaults to NULL
.
Colors for the left, middle, and right areas. Defaults to c("#e41a1c", "#377eb8", "#4daf4a").
Width for shiny.
Height for shiny.
Defaults to NULL
.
Defaults to 1
.
Defaults to FALSE
.
Defaults to ''
.
Defaults to FALSE
. When set to true, the initial transition stops at posterior density.
Defaults to FALSE
. When set to true, the x-axis tick format will be set to percentage.
Use an explicit element ID for the widget (rather than an automatically generated one). elementID for shiny.
Logo path. Defaults to NULL
.
Logo size. Defaults to FALSE
.
Logo location. c('bottom-right', 'top-left', 'top-right', 'bottom-left')
.
A HTML widget object.
A function to visualize draws from either the prior or posterior distribution, facilitating interpretation and decision-making.
if(interactive()){
set.seed(9782)
library(vizdraws)
vizdraws(prior = rnorm(100000))
}