Quick Generalized Full Matching

Provides functions for constructing near-optimal generalized full matching. Generalized full matching is an extension of the original full matching method to situations with more intricate study designs. The package is made with large data sets in mind and derives matches more than an order of magnitude quicker than other methods.


CRAN Status Build Status Build status codecov

quickmatch provides functions for constructing near-optimal generalized full matchings. Generalized full matching is an extension of the original full matching method to situations with more intricate study designs. The package is made with large data sets in mind and derives matchings more than an order of magnitude quicker than other methods.

How to install

quickmatch is on CRAN and can be installed by running:

install.packages("quickmatch")

How to install development version

It is recommended to use the stable CRAN version, but the latest development version can be installed directly from Github using devtools:

if (!require("devtools")) install.packages("devtools")
devtools::install_github("fsavje/quickmatch")

The package contains compiled code, and you must have a development environment to install the development version. (Use devtools::has_devel() to check whether you do.) If no development environment exists, Windows users download and install Rtools and macOS users download and install Xcode.

Example on how to use quickmatch

# Load package
library("quickmatch")
 
# Construct example data
my_data <- data.frame(y = rnorm(100),
                      x1 = runif(100),
                      x2 = runif(100),
                      treatment = factor(sample(rep(c("T", "C"), c(25, 75)))))
 
# Make distances
my_distances <- distances(my_data, dist_variables = c("x1", "x2"))
 
### Average treatment effect (ATE)
 
# Make matching
my_matching_ate <- quickmatch(my_distances, my_data$treatment)
 
# Covariate balance
covariate_balance(my_data$treatment, my_data[c("x1", "x2")], my_matching_ate)
 
# Estimate effect
lm_match(my_data$y, my_data$treatment, my_matching_ate)
 
 
### Average treatment effect of the treated (ATT)
 
# Make matching
my_matching_att <- quickmatch(my_distances, my_data$treatment, target = "T")
 
# Covariate balance
covariate_balance(my_data$treatment, my_data[c("x1", "x2")], my_matching_att, target = "T")
 
# Estimate effect
lm_match(my_data$y, my_data$treatment, my_matching_att, target = "T")

News

quickmatch 0.2.1

  • Requires scclust 0.2.0 to fix erroneous error message.

quickmatch 0.2.0

  • Makes defaults and error messages friendlier with discrete covariates
  • Changes so matching_weights returns zero for unassigned units.

quickmatch 0.1.3

  • Adds function for covariate averages.
  • Updates maintainer information.

quickmatch 0.1.2

  • Initial release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("quickmatch")

0.2.1 by Fredrik Savje, 6 months ago


https://github.com/fsavje/quickmatch


Report a bug at https://github.com/fsavje/quickmatch/issues


Browse source code at https://github.com/cran/quickmatch


Authors: Fredrik Savje [aut, cre] , Jasjeet Sekhon [aut] , Michael Higgins [aut]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports sandwich, scclust, stats

Depends on distances

Suggests testthat


See at CRAN