I would like to use propensity scores that I developed from a multilevel logistic model as the distance measure for matching using the MatchIt package in R. The documentation for MatchIt says that I can use my own distance measure with the distance option, but how do I specify it? I have tried:
set.seed(1234)
m.out.M1 <- matchit(data=retention, method="nearest", m.order="random",
distance= M1_PS, caliper=.2)
M1_PS is the variable name of my distance measure that is in the dataset, but I get error message, "M1_PS not found". I did not include a formula statement in my code because I'm assuming that I do not need one if I am using my own distance measure.