RANGEMATCH: Stata module to perform range and interval-overlap joins between datasets
Timothy P Copeland ()
Additional contact information
Timothy P Copeland: Karolinska Institutet
Statistical Software Components from Boston College Department of Economics
Abstract:
rangematch performs a range join between the dataset in memory and a using dataset stored on disk or in a named frame. In point-in-interval mode it pairs each master observation with every using observation whose key variable falls inside the master [low, high] interval; in interval-overlap mode, requested with overlap(), it pairs master intervals with every overlapping using interval. Matching can be restricted within by() groups, and options control endpoint closure, floating-point boundary tolerance, the policy for missing keys or bounds, retention of only the nearest match before or after the key with tie handling, treatment of unmatched master and using rows, signed key distances, original row identifiers, a ceiling on output size, and assertions that required matches exist. Output replaces the data in memory or is written to a named frame or a dataset on disk, and a dry-run mode reports pair counts without producing output. Workspace is managed in Stata frames and pairs are generated by Mata binary-search or sweep backends, with no external dependencies. The command returns counts of master, using, matched, and unmatched rows, missing-bound and missing-key diagnostics, optional match-density statistics, and the backend used in r().
Language: Stata
Requires: Stata version 16.1
Keywords: range join; interval matching; interval overlap; merge; frames; nearest match; Mata (search for similar items in EconPapers)
Date: 2026-10-30
Note: This module should be installed from within Stata by typing "ssc install rangematch". The module is made available under terms of the MIT license (https://opensource.org/licenses/MIT).
References: Add references at CitEc
Citations:
Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/r/rangematch.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/_/_rangematch_mata.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/r/rangematch.sthlp help file (text/plain)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s459962
Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php
Access Statistics for this software item
More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().