Skip to contents

Histogram of bootstrap estimates

Usage

# S3 method for class 'atefit'
plot(
  x,
  bins,
  alpha = 1,
  title = waiver(),
  theme = precmed_plot_theme(),
  null.value = 0,
  metrics = NULL,
  ...
)

Arguments

x

An object of class "atefit".

bins

Number of bins

alpha

Histogram bar opacity, between 0 and 1. Defaults to 1.

title

The text for the title

theme

A ggplot2 theme. By default, a customized minimal theme is used; supply, for example, ggplot2::theme_classic() to use another theme.

null.value

Reference value on the plotted effect scale. Defaults to 0 (no risk difference or a ratio of 1); use NULL or NA to omit the null line.

metrics

Character vector of metrics to plot, in display order. For binary fits, choose from "risk0", "risk1", and "risk_difference". For count fits, choose from "rate0", "rate1", and "log_rate_ratio"; for survival fits, choose from "rmst0", "rmst1", "log_rmtl_ratio", and "log_cumulative_hazard_ratio", "risk0", "risk1", and "risk_difference". Older survival fits may instead contain "log_hazard_ratio". The default NULL plots all metrics available in the object. Dotted spellings such as "risk.difference" remain supported. Survival panels are arranged in up to three columns, with RMST and log RMTL ratio first, risks and risk difference next, and the log cumulative hazard ratio last. Explicit metrics are plotted in supplied order.

...

Other parameters

Value

A plot of the class ggplot, displaying the estimated ATE across the bootstrap samples

Details

Create a histogram displaying the distribution of the bootstrap estimates. The solid red vertical line represents the full-sample estimate. A dashed black line marks null.value in risk-difference and log-ratio panels; it is not shown in treatment-specific risk, rate or RMST panels. Treatment-specific facets use the original treatment labels when available. Older binary or count objects without treatment-specific bootstrap estimates show only the risk difference or log rate ratio, respectively.

Author

Thomas Debray