Calculates unadjusted weights under I = 1, using the nearest-neighbors method
nn_wgt(Y, X, control = NULL, wgt = rep(1, length(Y)), lambda = 100,
sigma = 1, test = F)
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.
if TRUE, returns weights matrix (only used for testing).
vector of unadjusted weights under I = 1