multilevel_kernel_qp: Re-weight control sub-groups to treated sub-group with kernel...

View source: R/multilevel_kernel_QP.R

multilevel_kernel_qpR Documentation

Re-weight control sub-groups to treated sub-group with kernel imbalance

Description

Re-weight control sub-groups to treated sub-group with kernel imbalance

Usage

multilevel_kernel_qp(
  X,
  trt,
  Z,
  kernel = kernlab::vanilladot(),
  lambda = 0,
  lowlim = 0,
  uplim = 1,
  scale_sample_size = T,
  exact_global = T,
  verbose = TRUE,
  eps_abs = 1e-05,
  eps_rel = 1e-05,
  ...
)

Arguments

X

n x d matrix of covariates

trt

Vector of treatment assignments

Z

Vector of group indicators with J levels

kernel

Kernel to compute balance measure with, default is the inner product

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 T

exact_global

Whether to enforce exact balance for overall population

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 Jan. 17, 2024, 2:56 p.m.