#load the data
data(icu.data)
#the covariate matrix is
X = as.matrix(subset(icu.data, select = -c(open_bin, icu_bed)))
#mahalanobis distance across the treatment
getMD(X = X, indicator = icu.data$icu_bed)
#mahalanobis distance across the instrument
getMD(X = X, indicator = icu.data$open_bin)
Run the code above in your browser using DataLab