Learn R Programming

MultiObjMatch (version 1.0.0)

Multi-Objective Matching Algorithm

Description

Matching algorithm based on network-flow structure. Users are able to modify the emphasis on three different optimization goals: two different distance measures and the number of treated units left unmatched. The method is proposed by Pimentel and Kelz (2019) . The 'rrelaxiv' package, which provides an alternative solver for the underlying network flow problems, carries an academic license and is not available on CRAN, but may be downloaded from Github at .

Copy Link

Version

Install

install.packages('MultiObjMatch')

Monthly Downloads

167

Version

1.0.0

License

MIT + file LICENSE

Maintainer

Shichao Han

Last Published

July 4th, 2024

Functions in MultiObjMatch (1.0.0)

convert_index

An internal helper function that translates the matching index in the sorted data frame to the original dataframe's row index
excludeCosts

Create a skeleton representation of the exclusion edge costs
costSkeleton

Create cost skeleton
getPropensityScore

Fit propensity scores using logistic regression.
get_balance_table

Generate balance table
get_unmatched

Get unmatched percentage
flattenSkeleton

Turns a skeleton representation of edge costs in a network
generateRhoObj

Penalty and objective values summary
get_tv_graph

Marginal imbalance vs. exclusion
obj.to.match

An internal helper function that transforms the output from the RELAX algorithm to a data structure that is more interpretable for the output of the main matching function
extractEdges

Extract edges from the network
makeInfinitySparseMatrix

Internal helper to build infinity sparse matrix
makeSparse

Helper function to mask edges
matrix2cost

change the distance matrix to cost
get_five_index

An internal helper function that gives the index of matching with a wide range of number of treated units left unmatched
meldMask

Helper function to combine two sparse distances
netFlowMatch

Create network flow structure
filter_match_result

Filter match result
extractSupply

Extract the supply nodes from the net
get_pairdist_balance_graph

Total variation imbalance vs. marginal imbalance
matrix2edgelist

Helper function to convert matrix to list
getExactOn

Generate a factor for exact matching.
generate_rhos

Generate rho pairs
pairCosts

Create a skeleton representation of the edge costs
get_pairdist_graph

Distance vs. exclusion
solveP1

Solve the network flow problem - twoDistMatch
solveP

Solve the network flow problem - basic version
rho_proposition

Generate penalty coefficient pairs
matched_data

Get matched dataframe
two_dist_match

Optimal tradeoffs among two distances and exclusion
summary.multiObjMatch

Generate numerical summary
get_rho_obj

Penalty and objective values summary
matched_index

An internal helper function that translate the matching index in the sorted data frame to the original dataframe's row index
visualize

Visualize tradeoffs
addExclusion

Add exclusion edges
balanceCosts

Create a skeleton representation of the balance edge costs
addBalance

Add fine balance edges
combine_dist

An internal helper function that combines two distance object
combine_match_result

Combine two matching result
check_representative

Check the representativeness of matched treated units
callrelax

Call relax on the network
build.dist.struct_user

An internal helper function that generates the data abstraction for the edge weights of the main network structure using the distance matrix passed by the user.
build.dist.struct

An internal helper function that generates the data abstraction for the edge weights of the main network structure.
compare_matching

Generate covariate balance in different matches
distanceFunctionHelper

Helper function that change input distance matrix
dummy

This is a modified version of the function "dummy" from the R package dummies. Original code Copyright (c) 2011 Decision Patterns.
descr.stats_general

Generate summary statistics for matches
convert_names

Internal helper function that converts axis name to internal variable name
data_precheck

Data precheck: Handle missing data(mean imputation) and remove redundant columns; it also adds an NA column for indicating whether it's missing
dist_bal_match

Optimal tradeoffs among distance, exclusion and marginal imbalance
compare_tables

Summarize covariate balance table
edgelist2ISM

Change the edgelist to the infinity sparse matrix