This function performs a pair-matching using two user-specified distance matrices and two calipers. Typically one distance matrix is used to minimize matched-pair differences, and a second distance matrix is used to enforce constraints on marginal distributions of certain variables.
match_2C_mat(
Z,
dataset,
dist_mat_1,
dist_mat_2,
lambda,
controls = 1,
p_1 = NULL,
caliper_1 = NULL,
k_1 = NULL,
p_2 = NULL,
caliper_2 = NULL,
k_2 = NULL,
penalty = Inf,
overflow = FALSE
)
This function returns a list of three objects including the feasibility of the matching problem and the matched controls organized in different formats. See the documentation of the function construct_outcome or the tutorial for more details.
A length-n vector of treatment indicator.
The original dataset.
A user-specified treatment-by-control (n_t-by-n_c) distance matrix.
A second user-specified treatment-by-control (n_t-by-n_c) distance matrix.
A penalty that controls the trade-off between two parts of the network.
Number of controls matched to each treated.
A length-n vector on which caliper_1 applies, e.g. a vector of propensity score.
Size of caliper_1.
Maximum number of controls each treated is connected to in the first network.
A length-n vector on which caliper_2 applies, e.g. a vector of propensity score.
Size of caliper_2.
Maximum number of controls each treated is connected to in the second network.
Penalty for violating the caliper. Set to Inf by default.
A logical value indicating if overflow protection is turned on.
This function performs a pair matching via a two-part network. The first part is a network whose treatment-to-control distance matrix is supplied by dist_mat_1. The second part of the network is constructed using distance matrix specified by dist_mat_2. Often, the first part of the network is used to minimize total treated-to-control matched pair distances, and the second part is used to enforce certain marginal constraints.
The function constructs two list representations of distance matrices, possibly using the caliper. caliper_1 is applied to p_1 (caliper_2 applied to p_2) in order to construct sparse list representations. For instance, a caliper equal to 0.2 (caliper_1 = 0.2) applied to the propensity score (p_1).
lambda is a penalty, or a tuning parameter, that balances these two objectives. When lambda is very large, the network will first minimize the second part of network and then the first part.