matched.distances: Determine distances between matched units

Description Usage Arguments Details Value Author(s) Examples

View source: R/matched.distances.R

Description

From a match (as produced by pairmatch or fullmatch) and a distance, extract the distances of matched units from their matched counterparts.

Usage

1
matched.distances(matchobj, distance, preserve.unit.names = FALSE)

Arguments

matchobj

Value of a call to pairmatch or fullmatch.

distance

Either a distance matrix or the value of a call to or match_on.

preserve.unit.names

Logical. If TRUE, for each matched set matched.distances returns the submatrix of the distance matrix corresponding to it; if FALSE, a vector containing the distances in that submatrix is returned.

Details

From a match (as produced by pairmatch or fullmatch) and a distance, extract the distances of matched units from their matched counterparts.

Value

A list of numeric vectors (or matrices) of distances, one for each matched set. Note that a matched set with 1 treatment and k controls, or with k treatments and 1 control, has k, not k+1, distances.

Author(s)

Ben B. Hansen

Examples

1
2
3
4
5
data(plantdist)
plantsfm <- fullmatch(plantdist)
(plantsfm.d <- matched.distances(plantsfm,plantdist,pres=TRUE))
unlist(lapply(plantsfm.d, max))
mean(unlist(plantsfm.d))

markmfredrickson/optmatch documentation built on June 17, 2018, 12:46 a.m.