Calculates adjusted weights under I = 1, using the nearest-neighbors method
nn(Y, X, control = NULL, wgt = rep(1, length(Y)), lambda = 100,
sigma = 1, grp.size = 30, ...)
outcome vector (must be numeric without NA's).
numeric data frame or matrix of factors to be considered.
numeric data frame or matrix of factors to control for. these are factors that we can't consider while looking for the optimal intervention (e.g. race).
an optional vector of weights.
the lagrange multiplier. also known as the shadow price of an intervention.
distance penalty for the nearest-neighbors method.
for the nearest-neighbors method; if the number of examples in each
control group is smaller than grp.size, performs weight adjustment
using wgt_adjust
. else,
calculate weights seperatly for each control group.
additional arguments.
vector of adjusted weights under I = 1