two_dist_match {MultiObjMatch}R Documentation

Optimal tradeoffs among two distances and exclusion

Description

Explores tradeoffs among three objective functions in multivariate matching: sums of two different user-specified covariate distances within matched pairs, and the number of treated units included in the match.

Usage

two_dist_match(
  dist1_type = "user",
  dist2_type = "user",
  dist1_matrix = NULL,
  data = NULL,
  dist2_matrix = NULL,
  treat_col = NULL,
  dist1_col = NULL,
  dist2_col = NULL,
  exclusion_penalty = c(),
  dist2_penalty = c(),
  marg_bal_col = NULL,
  exact_col = NULL,
  propensity_col = NULL,
  pscore_name = NULL,
  ignore_col = NULL,
  max_unmatched = 0.25,
  caliper_option = NULL,
  tol = 0.01,
  max_iter = 1,
  rho_max_factor = 10,
  max_pareto_search_iter = 5
)

Arguments

dist1_type

One of ("euclidean", "robust_mahalanobis", "user") indicating the type of distance that are used for the first distance objective functions. NULL by default.

dist2_type

One of ("euclidean", "robust_mahalanobis", "user") charactor indicating the type of distance that are used for the second distance objective functions. NULL by default.

dist1_matrix

(optional) matrix object that represents the distance matrix using the first distance measure; dist1_type must be passed in as "user" if dist1_matrix is non-empty

data

(optional) data frame that contain columns indicating treatment, outcome and covariates

dist2_matrix

(optional) matrix object that represents the distance matrix using the second distance measure; dist2_type must be passed in as "user" if dist2_matrix is non-empty

treat_col

(optional) character, name of the column indicating treatment assignment.

dist1_col

(optional) character vector names of the variables used for calculating covariate distance using first distance measure specified by dType

dist2_col

(optional) character vector, names of the variables used for calculating covariate distance using second distance measure specified by dType1

exclusion_penalty

(optional) numeric vector, penalty values associated with exclusion. Empty by default, where auto grid search is triggered.

dist2_penalty

(optional) numeric vector, penalty values associated with the distance specified by dist2_matrix or dist2_type. Empty by default, where auto grid search is tiggered.

marg_bal_col

(optional) character, column name of the variable on which to evaluate balance.

exact_col

(optional) character vector, names of the variables on which to match exactly; NULL by default.

propensity_col

character vector, names of columns on which to fit a propensity score model.

pscore_name

(optional) character, name of the column containing fitted propensity scores; default is NULL.

ignore_col

(optional) character vector of variable names that should be ignored when constructing the internal matching. NULL by default.

max_unmatched

(optional) numeric, maximum proportion of unmatched units that can be accepted; default is 0.25.

caliper_option

(optional) numeric, the propensity score caliper value in standard deviations of the estimated propensity scores; default is NULL, which is no caliper.

tol

(optional) numeric, tolerance of close match distance; default is 1e-2.

max_iter

(optional) integer, maximum number of iterations to use in searching for penalty combintions that improve the matching; default is 1, where the algorithm searches for one round.

rho_max_factor

(optional) numeric, the scaling factor used in proposal for penalties; default is 10.

max_pareto_search_iter

(optional) numeric, the number of tries to search for the tol that yield pareto optimal solutions; default is 5.

Details

Matched designs generated by this function are Pareto optimal for the three objective functions. The degree of relative emphasis among the three objectives in any specific solution is controlled by the penalties, denoted by Greek letter rho. Larger values for the penalties associated with the two distances correspond to increased emphasis close matching on these distances, at the possible cost of excluding more treated units. Additional details:

Value

a named list whose elements are:

See Also

Other main matching function: dist_bal_match()

Examples

x1 = rnorm(100, 0, 0.5)
x2 = rnorm(100, 0, 0.1)
x3 = rnorm(100, 0, 1)
x4 = rnorm(100, x1, 0.1)
r1ss <- seq(0.1,50, 10)
r2ss <- seq(0.1,50, 10)
x = cbind(x1, x2, x3,x4)
z = sample(c(rep(1, 50), rep(0, 50)))
e1 = rnorm(100, 0, 1.5)
e0 = rnorm(100, 0, 1.5)
y1impute = x1^2 + 0.6*x2^2 + 1 + e1
y0impute = x1^2 + 0.6*x2^2 + e0
treat = (z==1)
y = ifelse(treat, y1impute, y0impute)
names(x) <- c("x1", "x2", "x3", "x4")
df <- data.frame(cbind(z, y, x))
df$x5 <- 1
names(x) <- c("x1", "x2", "x3", "x4")
df <- data.frame(cbind(z, y, x))
df$x5 <- 1
d1 <- as.matrix(dist(df["x1"]))
d2 <- as.matrix(dist(df["x2"]))
idx <- 1:length(z)
treated_units <- idx[z==1]
control_units <- idx[z==0]
d1 <- as.matrix(d1[treated_units, control_units])
d2 <- as.matrix(d2[treated_units, control_units])
match_result_1 <- two_dist_match(data=df, treat_col="z",  dist1_matrix=d1, 
dist1_type= "User", dist2_matrix=d2,
dist2_type="User", marg_bal_col=c("x5"), exclusion_penalty=r1ss, 
dist2_penalty=r2ss,
propensity_col = c("x1"), max_iter = 0,
max_pareto_search_iter = 0) 

[Package MultiObjMatch version 1.0.0 Index]