View source: R/getStandardizedCovMeanDiffs.R
getStandardizedCovMeanDiffs | R Documentation |
getStandardizedCovMeanDiffs
returns the standardized covariate mean differences between two groups.
getStandardizedCovMeanDiffs(X, indicator)
X |
Covariate matrix (with units as rows and covariates as columns). |
indicator |
Binary indicator vector (must contain 1 or 0 for each unit). For example, could be a binary treatment or instrument. |
Standardized covariate mean differences between two groups.
Zach Branson and Luke Keele
Branson, Z. and Keele, L. (2020). Evaluating a Key Instrumental Variable Assumption Using Randomization Tests. American Journal of Epidemiology. To appear.
#load the data
data(icu.data)
#the covariate matrix is
X = as.matrix(subset(icu.data, select = -c(open_bin, icu_bed)))
#standardized covariate mean differences across the treatment
getStandardizedCovMeanDiffs(X = X, indicator = icu.data$icu_bed)
#standardized covariate mean differences across the instrument
getStandardizedCovMeanDiffs(X = X, indicator = icu.data$open_bin)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.