Plots a fitted zcurve_RoBMA object, visualizing the z-curve, model fit, extrapolation, and credible intervals.
# S3 method for zcurve_RoBMA
plot(
x,
conditional = FALSE,
plot_type = "base",
probs = c(0.025, 0.975),
max_samples = 500,
plot_fit = TRUE,
plot_extrapolation = TRUE,
plot_CI = TRUE,
plot_thresholds = TRUE,
from = -6,
to = 6,
by.hist = 0.5,
length.out.hist = NULL,
by.lines = 0.05,
length.out.lines = NULL,
dots_hist = NULL,
dots_extrapolation = NULL,
dots_thresholds = NULL,
...
)Returns NULL if plot_type = "base", or a ggplot2 object if plot_type = "ggplot2".
A zcurve_RoBMA object to be plotted.
whether conditional estimates should be
plotted. Defaults to FALSE which plots the model-averaged
estimates. Note that both "weightfunction" and
"PET-PEESE" are always ignoring the other type of
publication bias adjustment.
whether to use a base plot "base"
or ggplot2 "ggplot" for plotting. Defaults to
"base".
quantiles of the posterior samples to be displayed.
Defaults to c(.025, .975)
Maximum number of posterior samples to use for plotting credible intervals. Defaults to 500.
Should the model fit be included in the plot? Defaults to TRUE.
Should model extrapolation be included in the plot? Defaults to TRUE.
Should credible intervals be included in the plot? Defaults to TRUE.
Should significance thresholds be displayed in the plot? Defaults to TRUE.
Lower bound of the z-value range for plotting. Defaults to -6.
Upper bound of the z-value range for plotting. Defaults to 6.
Bin width for the histogram of observed z-values. Defaults to 0.5.
Number of bins for the histogram. If NULL, determined by by.hist. Defaults to NULL.
Step size for plotting model fit and extrapolation lines. Defaults to 0.05.
Number of points for plotting lines. If NULL, determined by by.lines. Defaults to NULL.
List of additional graphical parameters for the histogram.
For base R: border, col, density, angle.
For ggplot2: color, fill, alpha.
List of additional graphical parameters for the extrapolation line/ribbon.
For base R lines: lwd, col, lty.
For base R ribbon: col (will be alpha-blended), border.
For ggplot2 lines: linewidth, color, linetype.
For ggplot2 ribbon: fill, alpha.
List of additional graphical parameters for the threshold lines.
For base R: col, lty, lwd.
For ggplot2: color, linetype, linewidth.
Additional graphical arguments for the main fit line and ribbon (passed to lines.zcurve_RoBMA),
as well as basic plotting arguments.
For base R lines: lwd, col, lty.
For base R ribbon: col (will be alpha-blended), border.
For ggplot2 lines: linewidth, color, linetype.
For ggplot2 ribbon: fill, alpha.
Basic plotting arguments (both base R and ggplot2): xlab (x-axis label, default: "Z-Statistic"),
ylab (y-axis label, default: "Density"), main (plot title, default: ""),
ylim (y-axis limits). For base R only: xaxt (x-axis type, default: "s"),
yaxt (y-axis type, default: "s").
as_zcurve(), lines.zcurve_RoBMA(), hist.zcurve_RoBMA()
if (FALSE) {
# using the example data from Anderson et al. 2010 and fitting the default model
# (note that the model can take a while to fit)
fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n,
study_names = Anderson2010$labels, algorithm = "ss")
zcurve_fit <- as_zcurve(fit)
plot(zcurve_fit)
}
Run the code above in your browser using DataLab