quickmatch v0.2.1

0

Monthly downloads

0th

Percentile

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.

Readme

quickmatch

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")

Functions in quickmatch

Name Description
covariate_balance Covariate balance in matched sample
quickmatch-package quickmatch: Quick Generalized Full Matching
is.qm_matching Check qm_matching object
covariate_averages Covariate averages in matched sample
quickmatch Derive generalized full matchings
lm_match Regression-based matching estimator of treatment effects
matching_weights Unit weights implied by matching
qm_matching Constructor for qm_matching objects
No Results!

Last month downloads

Details

Type Package
Date 2018-08-24
NeedsCompilation yes
License GPL (>= 3)
URL https://github.com/fsavje/quickmatch
BugReports https://github.com/fsavje/quickmatch/issues
Encoding UTF-8
RoxygenNote 6.1.0
Packaged 2018-08-24 19:11:29 UTC; fredrik
Repository CRAN
Date/Publication 2018-08-24 21:00:02 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/quickmatch)](http://www.rdocumentation.org/packages/quickmatch)