mundlak_weights: Re-weight control sub-groups to treated sub-group means

View source: R/mundlak.R

mundlak_weightsR Documentation

Re-weight control sub-groups to treated sub-group means

Description

Re-weight control sub-groups to treated sub-group means

Usage

mundlak_weights(
  ind_covs,
  interact_covs,
  trt,
  Z,
  lambda = 0,
  lowlim = 0,
  uplim = 1,
  scale_sample_size = TRUE,
  exact_global = TRUE,
  verbose = TRUE,
  eps_abs = 1e-05,
  eps_rel = 1e-05,
  ...
)

Arguments

ind_covs

n x d1 matrix of covariates for individual units

interact_covs

n x d2 matrix of interactions between individual and cluster covariates

trt

Vector of treatment assignments

Z

Vector of group indicators with J levels

lambda

Regularization hyper parameter, default 0

lowlim

Lower limit on weights, default 0

uplim

Upper limit on weights, default 1

scale_sample_size

Whether to scale the dispersion penalty by the sample size of each group, default TRUE

exact_global

Whether to enforce exact balance for overall population on individual covariates

verbose

Whether to show messages, default T

eps_abs

Absolute error tolerance for solver

eps_rel

Relative error tolerance for solver

...

Extra arguments for osqp solver

Value

  • weights Estimated weights as a length n vector

  • imbalance Imbalance in covariates as a d X J matrix

  • global_imbalanceOverall imbalance in covariates, as a length d vector


ebenmichael/balancer documentation built on Feb. 21, 2025, 7:50 a.m.