assess_covariate_balance: Assess balance in multivariate covariate distributions...

Description Usage Arguments Value Examples

View source: R/propensity.R

Description

Assess balance in multivariate covariate distributions directly or by using propensity scores.

Usage

1
assess_covariate_balance(data, x, w, p = NULL, method = "Mahalanobis distance")

Arguments

data

a dataframe object containing the variables and values.

x

a list of character vectors specifying the covariates.

w

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

p

a numeric vector of propensity scores. Only specified if method = "NLPD".

method

a character vector specifying the which method to use to assess balance (one of "Mahalanobis distance" or "NLPD")

Value

a numeric value for difference between the covariate distributions for treated and control groups.

Examples

1
2
3
4
5
6
7
8
9
data(lalonde)

vars <- names(lalonde)
covariates <- vars[!vars %in% c("re78", "treat")]

assess_covariate_balance(lalonde, x = covariates, w = "treat")
p <- propensity_score(lalonde, y = "re78", w = "treat")

assess_covariate_balance(lalonde, x = covariates, w = "treat", p = p, method = "NLPD")

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