mean_balance {causalOT} | R Documentation |
Standardized absolute mean difference calculations
Description
This function will calculate the difference in means between treatment groups standardized by the pooled standard-deviation of the respective covariates.
Usage
mean_balance(x = NULL, z = NULL, weights = NULL, ...)
Arguments
x |
Either a matrix, an object of class dataHolder, or an object of class DataSim |
z |
A integer vector denoting the treatments of each observations. Can be null if |
weights |
An object of class causalWeights. |
... |
Not used at this time. |
Value
A vector of mean balances
Examples
n <- 100
p <- 6
x <- matrix(stats::rnorm(n * p), n, p)
z <- stats::rbinom(n, 1, 0.5)
weights <- calc_weight(x = x, z = z, estimand = "ATT", method = "Logistic")
mb <- mean_balance(x = x, z = z, weights = weights)
print(mb)
[Package causalOT version 1.0.2 Index]