Re: Matching when each subject has multiple records, but each subject should be used only once in the match

"Sorkin, John" <[email protected]>
Newsgroups gmane.comp.lang.r.general
Message-ID <DM6PR03MB504929E6C464C8581DE18B46E216A@DM6PR03MB5049.namprd03.prod.outlook.com>
I should have added that I want to propensity score match the subjects, which normally could be accomplished with MatchIt, but MatchIt will not, as far as I can determine, work with longitudinal data if I want each subject to be matched exactly once.

John David Sorkin M.D., Ph.D.
Professor of Medicine, University of Maryland School of Medicine;
Associate Director for Biostatistics and Informatics, Baltimore VA Medical Center Geriatrics Research, Education, and Clinical Center;
PI Biostatistics and Informatics Core, University of Maryland School of Medicine Claude D. Pepper Older Americans Independence Center;
Senior Statistician University of Maryland Center for Vascular Research;

Division of Gerontology and Paliative Care,
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
Cell phone 443-418-5382





________________________________________
From: R-help <[email protected]> on behalf of Sorkin, John <[email protected]>
Sent: Thursday, September 18, 2025 7:08 AM
To: Leo Mada via R-help <[email protected]>
Subject: [R] Matching when each subject has multiple records, but each subject should be used only once in the match


I have a file that contains longitudinal data for each subject. As a result, each subject can have multiple records. For example a given subject might have a record in Jan 2020, another in June 2020, another in Feb 2021, another in May 2021, another in Sept 2022, etc. At each time for which a subject has a record the subject is identified as a case or a control.

Over the course of the longitudinal data, I want to match a given case to a given control. Once a subject is matched, I don't want the subject to be eligible for being matched again.

If each subject had a single record, matching could easily be accomplished. How can I accomplish the match in my file having repeated measures for each subject?

John David Sorkin M.D., Ph.D.
Professor of Medicine, University of Maryland School of Medicine;
Associate Director for Biostatistics and Informatics, Baltimore VA Medical Center Geriatrics Research, Education, and Clinical Center;
PI Biostatistics and Informatics Core, University of Maryland School of Medicine Claude D. Pepper Older Americans Independence Center;
Senior Statistician University of Maryland Center for Vascular Research;

Division of Gerontology and Paliative Care,
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
Cell phone 443-418-5382



______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.r-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.