standardize_treatment_kernel: Re-weight groups to target population means

View source: R/standardize_treatment_kernel.R

standardize_treatment_kernelR Documentation

Re-weight groups to target population means

Description

Re-weight groups to target population means

Usage

standardize_treatment_kernel(
  X0,
  Xtau,
  Xtarget,
  S,
  Z,
  pscores,
  kernel0 = kernlab::vanilladot(),
  kerneltau = kernlab::vanilladot(),
  lambda = 0,
  lowlim = 0,
  uplim = nrow(X0),
  scale_sample_size = F,
  data_in = NULL,
  verbose = TRUE,
  return_program = TRUE,
  init_uniform = F,
  eps_abs = 1e-05,
  eps_rel = 1e-05,
  gc = TRUE,
  ...
)

Arguments

X0

n x d0 matrix of untransformed covariates defining the mean control response function

Xtau

n x dtau matrix of untransformed covariates defining the mean treatment effect function

Xtarget

ntarget x dtau matrix of untransformed covariates constituting the target population

S

Numeric vector of site indicators with J levels

Z

Numeric vector of treatment indicators with 2 levels

pscores

Numeric vector of propensity scores

kernel0

Kernel for control outcome covariates, default is the inner product

kerneltau

Kernel for treatment effect covariates, default is the inner product

lambda

Regularization hyper parameter, default 0

lowlim

Lower limit on weights, default 0

uplim

Upper limit on weights, default nrow(X0)

scale_sample_size

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

data_in

Optional list containing pre-computed objective matrix/vector and constraints (without regularization term)

verbose

Whether to show messages, default T

return_program

Whether to return the objective matrix and vector and constraints, default T

init_uniform

Wheter to initialize solver with uniform weights, default F

eps_abs

Absolute error tolerance for solver

eps_rel

Relative error tolerance for solver

gc

boolean indicating whether to garbage collect between operations

...

Extra arguments for osqp solver

Value

  • weights Estimated primal weights as an n x J matrix

  • imbalance_0 Imbalance in covariates defining mean control response function as a d0 x J matrix

  • imbalance_tau Imbalance in covariates defining mean treatment effect function as a dtau x J matrix

  • data_out List containing elements of QP min 0.5 x'Px + q'x st l <= Ax <= u

    • P, q

    • constraints A, l , u


ebenmichael/balancer documentation built on Jan. 17, 2024, 2:56 p.m.