I don't think you will get a useful response without providing a subset of your data with detailed information on what variables are the subject specific covariates to be used for propensity score matching, what your response(s) is/are, how you intend to model the responses (e.g. survival time or death, or whatever it is), whether there are time specific covariates, etc.
It is not even clear to me whether propensity score matching is useful/appropriate -- but what do I know?! It is also not clear to me that this is an R programing issue or a statistical issue and therefore not really on topic for this list. Obviously, feel free to ignore any/all of the above. Cheers, Bert On Thu, Sep 18, 2025 at 8:03 AM Sorkin, John <jsor...@som.umaryland.edu> wrote: > Naresh, > > I appreciate your reply. > > In my original posting, I neglected to mention that I want to propensity > score match the two groups. I don't think you suggestion will help me > propensity score match my data. Am I missing something? > > Thank you, > John > > 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 <r-help-boun...@r-project.org> on behalf of Naresh Gurbuxani > <naresh_gurbux...@hotmail.com> > Sent: Thursday, September 18, 2025 10:10 AM > To: r-help@r-project.org <r-help@r-project.org> > Subject: [R] Fwd: Matching when each subject has multiple records > > > > > > > mydf <- data.frame(date = as.Date("2010-01-01") + sample(500, size = > 20), subject = sample(c("A", "B", "C"), 20, replace = TRUE), first = FALSE) > > mydf <- mydf[order(mydf$date),] > > df_split <- split(mydf, f = mydf$subject) > > df_split <- lapply(df_split, function(df) {df[1, "first"] <- TRUE; df}) > > mydf <- do.call(rbind, df_split) > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org 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. > > > ______________________________________________ > R-help@r-project.org 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. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.