Closed buhtz closed 1 year ago
What you want is a called a "caliper" and is controlled by the caliper
and std.caliper
options. caliper
lets you specify the width of the desired caliper on the variables you want to place it on (in this case, a caliper of 3 on bar
), and std.caliper
controls whether the caliper is in raw or standardized units (by default, they are standardized).
To request 1:1 matching with a caliper of 3 on bar
and exact matching on foo
, you would do
matchit(group ~ bar + foo, data = df, method = "nearest", distance = "scaled_euclidean",
caliper = c(bar = 3), std.caliper = FALSE, exact = ~foo)
Thanks a lot for that.
In the example below I do 1:1 matching (as discussed in #164). The variable
bar
is numeric and I want to specify a tolerance of3
to it. That means10
could also be matched with values between7
and13
. But the other variablefoo
should match exact.I assume I miss the correct term for this and that is why I couldn't find the correct section in the matchit manual. Could you give me a hint please?