Learn R Programming

nearfar (version 1.3)

calipers: Matching priority function

Description

Updates given distance matrix to prioritize specified measured confounders in a pair match. Used in consort with matches function to prioritize specific measured confounders in a near-far match in the opt_nearfar function.

Usage

calipers(distmat, variable, tolerance = 0.2)

Value

Returns an updated distance matrix

Arguments

distmat

An object of class distance matrix

variable

Named variable from list of measured confounders

tolerance

Penalty to apply to mismatched observations; values near 0 penalize mismatches more

See Also

matches, opt_nearfar

Examples

Run this code
dd = mtcars[1:4, 2:3]
cc = calipers(distmat=smahal(dd), variable=dd$cyl, tolerance=0.2)
cc

Run the code above in your browser using DataLab