Description Usage Arguments Details
View source: R/covariate-balance.R
Visualize covariate balance at the discontinuity
1 2 3 4 5 6 7 8 9 10 11 |
data |
Data to use for covariate balance checks |
rv |
The running variable to use in the discontinuity |
cov |
Vector of covariate names to plot |
aggregate |
Whether to aggregate observations within each bin for visualization purposes |
geom |
Representation binned points, the name of any geom. See the ggplot2 website. |
fit_method |
Method to use to fit regression line for balance checks |
... |
other parameters to be passed to geom_smooth, the call which plots the line |
Covariate balance tests allow us to visualize whether important characteristics differ on either side of the regression discontinuity boundary.
The sum_method indicates how data is meant to be binned for visualization purposes. Currently it defaults to "raw" but it will also accept "mean", "median", and "pointrange", which will plot a point-range for each bin on the x axis.
The fit_method argument defaults to a linear regression using all the data. Other acceptable arguments are "loess" for local linear regression, "gam" for generalized additive models, "quadratic" for a quadratic fit using the whole dataset.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.