| conformal_plot | R Documentation |
Visualizes the distribution of estimated individual treatment effects (ITEs)
along with their corresponding conformal prediction intervals.
The function randomly samples a proportion of observations from a fitted
metalearner_ensemble or metalearner_deeplearning object and
plots the conformal intervals as vertical ranges around the point estimates.
This allows users to visually assess the uncertainty and variation in
estimated treatment effects.
conformal_plot(
x,
...,
seed = 1234,
prop = 0.3,
binary.outcome = FALSE,
x.labels = TRUE,
x.title = "Observations",
color = "steelblue",
break.by = 0.5
)
x |
A fitted model object of class |
... |
Additional arguments (currently unused). |
seed |
Random seed for reproductibility of subsampling. Default is |
prop |
Proportion of observations to randomly sample for plotting.
Must be between 0 and 1. Default is |
binary.outcome |
Logical; if |
x.labels |
Logical; if |
x.title |
Character string specifying the x-axis title.
Default is |
color |
Color of the conformal intervals and points.
Default is |
break.by |
Numeric value determining the spacing between y-axis breaks.
Default is |
The function extracts the estimated ITEs (CATEs) and conformal intervals
(ITE_lower, ITE_upper) from the model output, samples a subset
of rows, and generates a ggplot2 visualization.
Each vertical line represents the conformal prediction interval for one observation’s
treatment effect estimate.
The conformal intervals are typically obtained from weighted split-conformal inference,
using propensity overlap weights to adjust interval width.
A ggplot object showing sampled individual treatment effects
with their weighted conformal prediction intervals.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.