quickmatch: Quickmatch algorithm

Description Usage Arguments Details Value Author(s) References Examples

View source: R/quickmatch7.R

Description

Given treatment and control groups, finds a pairing of treatment units to controls that maximizes number of matched disjoint pairs satisfying a given caliper.

Usage

1
quickmatch(x, z, caliper, controls = 1L, data, within, method = "nno")

Arguments

x

Numeric vector with the scores of treated and control objects, or formula, or glm.

z

If x is a numeric vector, z is a vector with 1 for treated objects

caliper

The caliper, i.e., the maximal distance allowed between

controls

The maximal number of controls matched to a single treated object

data

An optional data frame, list or environment for arguments x,z and within.

within

Vector of factors dividing objects into groups.

method

Method for matching: "nno" (default) for optimized NNM or "quickmatch".

Details

Quickmatch is generic function, calls one of its methods.

Value

A quickmatch object containing:

match.matrix: a (controls+1) columns matrix, each row containing the numbers of a matched treated (in col 1) and corresponding control (in columnss 2:(controls+1)) objects. The numbers of objects are positions in vector x. If, for a treated object, there are only 0<k<controls matches, the elements of the row in the cols (k+2):(controls+1) are filled with integer NAs.

num_pairs: vector of length total.matches showing the number of controls matched to each treated object. num_pairs[j] corresponds to the j-th row of match.matrix.

discarded.t: vector of the numbers (positions in x) of treated objects which are not matched.

discarded.c: vector of the numbers (positions in x) of control objects which are not matched.

total.matches: the number of matched treated objects, which is the number of rows in match.matrix.

total.pairs: the number of matched control objects, which is the number of non-NA elements in columns 2:(controls+1) of match.matrix

Author(s)

Pavel S. Ruzankin

Marina V. Muravleva

References

P.S. Ruzankin (2019). A fast algorithm for maximal propensity score matching. Methodol Comput Appl Probab. https://doi.org/10.1007/s11009-019-09718-4

Examples

1
quickmatch(c(1,1.1,2.5,1.5,0.2,2,0.5,2),c(0,1,0,1,0,1,0,1),0.5)

ruzankin/quickmatch documentation built on June 1, 2020, 12:28 a.m.