I am doing propensity score matching using R's MatchIt
library. I have more potential control units than treated units and I want to match using a caliper with replacement. As I understand from here and here, MatchIt
's caliper option defines the boundary of interest and then matches only the nearest neighbor within the caliper.
Request: I want to retain all matched units within the caliper. Is there a way to do this with MatchIt::matchit
or is there another implementation that I can use? I don't want the "nearest neighbor" step after the units within the caliper have been defined.
The code below is similar to my data and shows how the control N is bounded above by the number of treated units. Any guidance would be immensly helpful.
library(tidyverse)
library(MatchIt)
# load data
data("lalonde")
# specify propensity score formula
pscore_lhs_vars <- c(str_subset(names(lalonde), 'treat', negate=T))
pscore_formula <- as.formula(paste('treat~', paste(pscore_lhs_vars, collapse = "+")))
# perform match with replacement using a caliper in units
matches<- lalonde %>% matchit(pscore_formula,
data=.,
method='nearest',
distance='glm',
replace=T,
std.caliper = T,
caliper=(pscore=0.0000001))
# return matched data
match.data(matches, distance='pscore')
Just set ratio
to be a huge number (i.e., the number of control units). This will retain all units within a treated unit's caliper. Any treated unit that doesn't have that many matches in its caliper will simply be matched to as many as there are.