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
)A ggplot object showing sampled individual treatment effects
with their weighted conformal prediction intervals.
A fitted model object of class metalearner_ensemble
or metalearner_deeplearning that contains a conformal_interval element.
Additional arguments (currently unused).
Random seed for reproductibility of subsampling. Default is 1234.
Proportion of observations to randomly sample for plotting.
Must be between 0 and 1. Default is 0.3.
Logical; if TRUE, constrains the y-axis to
[-1, 1] for binary outcomes. Default is FALSE.
Logical; if TRUE, displays x-axis labels for each sampled observation.
Default is TRUE.
Character string specifying the x-axis title.
Default is "Observations".
Color of the conformal intervals and points.
Default is "steelblue".
Numeric value determining the spacing between y-axis breaks.
Default is 0.5.
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.