univariate_balance_plot: Assess balance for a single covairate.

Description Usage Arguments Value Examples

View source: R/propensity.R

Description

Assess balance for a single covairate.

Usage

1

Arguments

data

a dataframe object containing the variables and values.

covariate

a character vectors specifying the covariate

w

a character vector specifying the treatment variable. Treatment must be specified as 0 and 1 or TRUE and FALSE.

colors

an optional vector of two specifying the colors for the control and treatment groups, respectively.

title

an optional plot title.

Value

a ggplot object.

Examples

1
2
3
4
5
6
7
data(lalonde)

# histogram for continues variable: 
univariate_balance_plot(lalonde, "age", "treat")
# bar plot for discrete factor variable:
lalonde$hisp <- factor(lalonde$hisp)
univariate_balance_plot(lalonde, "hisp", "treat")

jackcollison/causality documentation built on Dec. 20, 2021, 8:05 p.m.