View source: R/plotting-assurance.R
| plot_design_prior | R Documentation |
Visualises one or more design prior distributions over the effect-size range used in a power analysis. Vertical dashed lines mark the grid points at which power was simulated, helping assess prior-grid alignment.
plot_design_prior(
prior_spec,
effect_grid,
labels = NULL,
n_points = 300L,
title = NULL,
subtitle = NULL
)
prior_spec |
A single prior specification list (e.g.
|
effect_grid |
Numeric vector of effect-grid values passed to
|
labels |
Character vector naming each prior. Defaults to
|
n_points |
Number of x points at which to evaluate the density curve (default 300). |
title, subtitle |
Optional plot title and subtitle strings. |
A ggplot object.
plot_design_prior(
prior_spec = list(dist = "normal", mean = 0.5, sd = 0.15),
effect_grid = c(0.2, 0.5, 0.8)
)
# Multiple priors
plot_design_prior(
prior_spec = list(
list(dist = "normal", mean = 0.5, sd = 0.10),
list(dist = "normal", mean = 0.5, sd = 0.30)
),
effect_grid = c(0.2, 0.5, 0.8),
labels = c("Informative", "Diffuse")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.