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?
MatchIt
. You should look into the packagedesignmatch
, which was written precisely for these problems where complicated constraints are desired. – Noah