| pair {cem} | R Documentation |
Produces a paired sample out of a CEM match solution
pair(obj, data, method=NULL, mpower=2, verbose=0)
obj |
an object as output from |
data |
the original data.frame used by |
method |
distance method to use in |
mpower |
power of the Minkowski distance. See Details. |
verbose |
controls level of verbosity. Default=0. |
This function returns a vector of paired matched units index.
The user can choose a method (between 'euclidean',
'maximum', 'manhattan', 'canberra', 'binary'
and 'minkowski') for nearest neighbor matching inside each
cem strata. By default method is set to 'NULL',
which means random matching inside cem strata. For the Minkowski
distance the power can be specified via the argument mpower'.
For more information on method != NULL, refer to
dist help page.
obj |
a list with the fields |
Stefano Iacus, Gary King, and Giuseppe Porro
Stefano Iacus, Gary King, Giuseppe Porro, “Matching for Casual Inference Without Balance Checking: Coarsened Exact Matching,” http://gking.harvard.edu/files/abs/cem-abs.shtml
data(LL) # cem match: automatic bin choice mat <- cem(data=LL, drop="re78") # we want a set of paired units psample <- pair(mat, data=LL) table(psample$paired) psample$paired[1:100] table(psample$full.paired) psample$full.paired[1:10] # cem match: automatic bin choice, we drop one row from the data set mat1 <- cem(data=LL[-1,], drop="re78") # we want a set of paired units but we have an odd number of units in the data psample <- pair(mat1, data=LL[-1,]) table(psample$full.paired)