2
votes

I'm new to R, and Im using matchit to match patients by propensity scores. My dataset includes two groups of patients that differ by whether or not they received a drug. As well as matching on propensity score, I also want to exact match on age, gender and family practice, as the decision to treat does vary significantly depending on these characteristics.

My problem is that I would like to exact match by age ± 2 years, as I would like to increase the number of treated patients that can be matched in my dataset, by increasing the flexibility of my exact matches (rather than using an arbitrary cut-off, as with an categorical age variable, for example).

The code below works well

match.1 <-  matchit(exposed ~ imd2010_5 + hyp + mhealth + mm_score + GP_consult + smoke + no_pres3m + lterm_pres + pres_rate, 
data=dataset_pscore2, 
distance=dataset_pscore2$pscores, 
method="nearest", 
exact=c("gender", "pracid", "age_cat"), 
discard="both", 
caliper=0.25, 
ratio=2)

Id just like to change the exact code to something like

exact=c("gender", "pracid", "age" *with a caliper*),

Is this possible?

1
This cannot be done with MatchIt. You should look into the package designmatch, which was written precisely for these problems where complicated constraints are desired.Noah

1 Answers

0
votes

As far as i can tell, Propensity Score Matching (PSM) usually uses a LOGIT regression to find the estimated propensity scores, as a way to avoid the curse of dimensionality.So, doing exact matching in some covariates in a PSM set-up sounds unlikely.

I suggest running two matching procedures: The first one with exact matching on the covariates which you would like to be exact matched. Then, running the PSM on the new matched-sample on the other covariates.

As an example:

match.1 <-  matchit(exposed ~ gender + pracid + age_cat, 
data=dataset_pscore2, 
method="exact")

matched_sample <- match.data(match.1) # Get Propensity Scores for 'matched_sample'

match.2 <-  matchit(exposed ~ imd2010_5 + hyp + mhealth + mm_score + GP_consult + smoke + no_pres3m + lterm_pres + pres_rate, 
data=matched_sample, 
distance=matched_sample2$pscores, 
method="nearest", 
discard="both", 
caliper=0.25, 
ratio=2)

I also suggest reading the MatchIt package documentation. And this other wonderfull package, called cem.