Description Usage Arguments Value Examples
Assess balance in multivariate covariate distributions directly or by using propensity scores.
1 | assess_covariate_balance(data, x, w, p = NULL, method = "Mahalanobis distance")
|
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 |
a character vector specifying the which method to use to assess balance (one of "Mahalanobis distance" or "NLPD") |
a numeric value for difference between the covariate distributions for treated and control groups.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.