Plot diagnostics for a causatr fit

Description

Produces diagnostic visualisations from a causatr_diag object. The which argument selects the plot type:

  • “balance” (default): a Love plot showing standardised mean differences via cobalt::love.plot(). Requires cobalt.

  • “weights”: weight-distribution histograms (one panel per intervention). Binary treatments are faceted by arm (treated / control); non-binary show the overall distribution. Requires tinyplot.

  • “positivity”: propensity-score histogram for binary treatments; conditional density histogram for continuous / count treatments; per-level bar chart for categorical treatments. Requires tinyplot.

Usage

## S3 method for class 'causatr_diag'
plot(
  x,
  which = c("balance", "weights", "positivity"),
  log_scale = FALSE,
  stats = "m",
  abs = TRUE,
  thresholds = c(m = 0.1),
  ...
)

Arguments

x A causatr_diag object returned by diagnose().
which Character. Type of diagnostic plot. One of “balance” (default), “weights”, or “positivity”.
log_scale Logical. For which = “weights”, apply log10 to the weight axis. Default FALSE.
stats Character. For which = “balance”, which balance statistic(s) to plot. Default “m” (standardised mean differences). See cobalt::love.plot() for options.
abs Logical. For which = “balance”, whether to plot absolute values. Default TRUE.
thresholds Named numeric vector. For which = “balance”, threshold lines to draw. Default c(m = 0.1).
Additional arguments passed to the plotting backend (cobalt::love.plot() for balance; tinyplot::plt() for weights and positivity).

Value

Invisibly returns x.

See Also

diagnose(), print.causatr_diag()