Reputation: 167
I would like to do case-control matching 1(1:N) in R.
For example, sex should be matched exactly.
On the other hand, age is matched with range +-5.
(e.g. if case's age=45, then I want to consider that the range of controls' age is 40 ~ 50.)
AS I know, MatchIt or matching package is for propensity score matching not for case-control.
Moreover, e1071 package does not support the function of range matching.
Please let me know how to do this.
Many thanks advance.
P.S. The example data can be used for matching with age and sex as below.
library(survival)
data(pbc)
data <- na.omit(pbc)
case:1, control:0 in "status" variable
(As this data is originally for competing risk analysis, you can not consider "2" in "status" variable.)
Upvotes: 0
Views: 1216
Reputation: 4414
This is called matching with a caliper. The caliper is on age and its value in this case is 5. MatchIt
allows calipers but only for the distance measure (i.e., the propensity score). Two other packages for matching, Matching
and optmatch
both allow highly customizable matching, including the requirements of exact matching (i.e., what you want for sex) and caliper matching (i.e., what you want for age). Matching
allows for nearest neighbor matching and genetic matching, while optmatch
allows for optimal matching.
Upvotes: 1