View source: R/nodesplit_summary-class.R
plot.nodesplit_summary | R Documentation |
Produce summary plots of node-splitting models
## S3 method for class 'nodesplit_summary'
plot(
x,
...,
pars = "d",
stat = "dens_overlay",
orientation = c("horizontal", "vertical", "y", "x"),
ref_line = NA_real_
)
x |
A |
... |
Additional arguments passed on to the underlying |
pars |
Character vector specifying the parameters to include in the
plot, choices include |
stat |
Character string specifying the |
orientation |
Whether the |
ref_line |
Numeric vector of positions for reference lines, by default no reference lines are drawn. |
Plotting is handled by ggplot2 and
the stats and geoms provided in the ggdist
package. As a result, the output is very flexible. Any plotting stats
provided by ggdist
may be used, via the argument stat
. The default
"dens_overlay"
is a special exception, which uses
ggplot2::geom_density()
, to plot
overlaid densities. Additional arguments in ...
are passed to the
ggdist
stat, to customise the output.
Alternative stats can be specified to produce different summaries. For
example, specify stat = "[half]eye"
to produce (half) eye plots, or stat = "pointinterval"
to produce point estimates and credible intervals.
A full list of options and examples is found in the ggdist
vignette
vignette("slabinterval", package = "ggdist")
.
A ggplot
object is returned which can be further modified through the
usual ggplot2 functions to add further
aesthetics, geoms, themes, etc.
A ggplot
object.
summary.nma_nodesplit_df()
# Run smoking node-splitting example if not already available
if (!exists("smk_fit_RE_nodesplit")) example("example_smk_nodesplit", run.donttest = TRUE)
# Summarise the node-splitting results
(smk_nodesplit_summary <- summary(smk_fit_RE_nodesplit))
# Plot the node-splitting results
plot(smk_nodesplit_summary)
# Plot the inconsistency factors instead, change the plot stat to half-eye,
# and add a reference line at 0
plot(smk_nodesplit_summary, pars = "omega", stat = "halfeye", ref_line = 0)
# Plot a comparison of the heterogeneity under the node-split models vs.
# the consistency model
plot(smk_nodesplit_summary, pars = "tau")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.