Plot Running Variable Outcomes with LOESS Fits
outcomes_plot.Rd
Generates a ggplot visualization of outcomes across running variable values, including standard LOESS fits and upper/lower bounds. Intended for use with partial‑identification analyses to illustrate treatment and outcome probabilities around the cutoff.
Usage
outcomes_plot(
prop,
xl,
Yl,
xr,
Yr,
upperWeights,
lowerWeights,
ylab,
xlab,
title,
order,
hist,
trueCounts,
cutoff
)
Arguments
- prop
Data.frame with columns
x_value
,avg.prop
.- xl
Numeric vector of x-values for left-side LOESS.
- Yl
Numeric vector of y-values for left-side LOESS.
- xr
Numeric vector of x-values for right-side LOESS.
- Yr
Numeric vector of y-values for right-side LOESS.
- upperWeights
Numeric vector of weights for the upper bound LOESS.
- lowerWeights
Numeric vector of weights for the lower bound LOESS.
- ylab
Character. Label for the y-axis.
- xlab
Character. Label for the x-axis.
- title
Character. Plot title.
- order
Integer. Degree of LOESS polynomial (1 = linear, 2 = quadratic).
- hist
Data.frame with histogram counts (
x_value
,Freq
).- trueCounts
Data.frame with non-manipulated observation counts (
x_value
,n_true
).- cutoff
Numeric. Running variable cutoff value.