Skip to contents

Visualizes a result estimate across your researcher degrees of freedom by plotting its specification curve as introduced by Simonsohn, Simmons and Nelson.

Usage

plot_rdf_spec_curve(
  ests,
  est,
  lb = "",
  ub = "",
  sample_frac = 1,
  est_label = est,
  title = "",
  est_color = "black",
  est_color_signeg = "#E41A1C",
  est_color_sigpos = "#377EB8",
  line_color = "black",
  ribbon = nrow(ests) > 30,
  ribbon_color = "gray90",
  choice_ind_point = TRUE,
  pt_size = 0.1,
  lower_to_upper = 3,
  highlight = NULL,
  pt_size_highlight = 3,
  addon_sc = NULL,
  addon_dc = NULL
)

Arguments

ests

The data frame provided by exhaust_design().

est

A character string indicating the estimate that you want to plot.

lb

A character string indicating the lower bound of the estimate.

ub

A character string indicating the upper bound of the estimate. If both lb und ub are present the plot includes a confindence interval around the estimate and colors the estimate points according to their significance (see below).

sample_frac

The percentage of the protocols that should be plottted. If your design produces many degrees of freedom, sampling speeds up plotting time and makes the plot less clutered.

est_label

Y-Axis label for the specification curve. Defaults to est.

title

A title for the plot

est_color

Color of estimates points for specification curve

est_color_signeg

Color of significantly negative estimates.

est_color_sigpos

Color of significantly positive estimates.

line_color

Color of confidence interval lines (only used when lb and ub are present).

ribbon

If TRUE a ribbon displaying the confidence interval is being plotted. If FALSE, lines are printed instead (looks nicer if you have only few degrees of freedom to plot) (only used when lb and ub are present).

ribbon_color

Color of the confidence interval (only used when lb and ub are present).

choice_ind_point

Whether you want your choice indicators to be points (TRUE) or vertical lines (FALSE).

pt_size

Point plot size for estimates and choice indicators that are not highlighted (see below).

lower_to_upper

The size of the choice part of the plot, relative to the specification curve itself.

highlight

NULL or, if you want to highlight certain protocols by their point size, a data frame containing the choices that identify the protocols.

pt_size_highlight

Point plot size for highlighted estimates and choice indicators.

addon_sc

ggplot objects to add to the the specification curve panel.

addon_dc

ggplot objects to add to the the design choice panel.

Value

Nothing. Instead the assembled grob is directly drawn.

Details

Significance of estimates is only dislayed when lb and ub are present. It is assessed by testing whether lb and ub are of equal sign.

See the vignette of the package for further details.

Examples

if (FALSE) {
  print("Sorry. No examples yet.")
}