## S3 method for class 'nodesplit_summary'plot( x,..., pars ="d", stat ="dens_overlay", orientation = c("horizontal","vertical","y","x"), ref_line =NA_real_)
Arguments
x: A nodesplit_summary object.
...: Additional arguments passed on to the underlying ggdist plot stat, see Details.
pars: Character vector specifying the parameters to include in the plot, choices include "d" for the direct, indirect, and network estimates of relative effects, "omega" for the inconsistency factor, and "tau"
for heterogeneity standard deviation in random effects models. Default is "d".
stat: Character string specifying the ggdist plot stat to use. The default "dens_overlay" is a special case, producing an overlaid density plot.
orientation: Whether the ggdist geom is drawn horizontally ("horizontal") or vertically ("vertical"), default "horizontal".
ref_line: Numeric vector of positions for reference lines, by default no reference lines are drawn.
Returns
A ggplot object.
Details
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.
Examples
# Run smoking node-splitting example if not already availableif(!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 resultsplot(smk_nodesplit_summary)# Plot the inconsistency factors instead, change the plot stat to half-eye,# and add a reference line at 0plot(smk_nodesplit_summary, pars ="omega", stat ="halfeye", ref_line =0)# Plot a comparison of the heterogeneity under the node-split models vs.# the consistency modelplot(smk_nodesplit_summary, pars ="tau")