# Function to find pair matches using a distance matrix. Called by opt.nearfar to discover optimal near-far matches.

### Description

Given values of percent sinks and cutpoint, this function will find the corresponding near-far match

### Usage

1 |

### Arguments

`X` |
A matrix of measured confounders (with column names) on which to make “near” in the matching |

`imp.var` |
A list of (up to 5) named variables to prioritize in the “near” matching |

`tol.var` |
A list of (up to 5) tolerances attached to the prioritized variables where 0 is highest penalty for mismatch |

`sinks` |
Percentage of the data to match to sinks (and thus remove) if desired; default is 0 |

`IV` |
Vector of instrumental variable values on which to make “far” in the matching |

`cutpoint` |
Value below which individuals are too similar on IV; increase to make individuals more “far” in match |

### Details

Default settings yield a "near" match on only observed confounders in X; add IV, sinks, and cutpoint to get near-far match.

### Value

A two-column matrix of row indices of paired matches

### Author(s)

Joseph Rigdon jrigdon@stanford.edu

### References

Lu B, Greevy R, Xu X, Beck C (2011). Optimal nonbipartite matching and its statistical applications. The American Statistician, 65(1), 21-30.

### See Also

`opt.nearfar`