plot_covbal: Visualize covariate balance at the discontinuity

Description Usage Arguments Details

View source: R/covariate-balance.R

Description

Visualize covariate balance at the discontinuity

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_covbal(
  data,
  rv,
  cov,
  aggregate = T,
  geom = "point",
  fit_method = "lm",
  binwidth = NULL,
  cutoff,
  ...
)

Arguments

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

Details

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.


be-green/shinyrd documentation built on April 14, 2020, 12:43 a.m.