0

#1:1 nearest neighbour

mod_match_one <- matchit(treatment ~ variable1 + variable2 + variable3, method = "nearest", data = trial_fixed, distance = "glm")

#is this correct if I am told to find 10-nearest neighbour?

mod_match_ten <- matchit(treatment ~ variable1 + variable2 + variable3, method = "nearest", data = trial_fixed, distance = "glm", ratio = 4)

#or is this correct? I am quite confused...

mod_match_ten <- matchit(treatment ~ variable1 + variable2 + variable3, method = "full", data = trial_fixed, distance = "glm", min.controls = 1, max.controls = 10)
Peter
  • 11,500
  • 5
  • 21
  • 31
Chie
  • 3
  • 1
  • 1
    Welcome to stack overflow. It’s easier to help if you make your question reproducible: include a minimal dataset in the form of an object for example if a data frame as df <- data.frame(…) where … is your variable(s) and values or use dput(head(df)). This will make it easy for others to help you by being able to test and verify solutions. These links may be of help: [mre] and [ask] – Peter Apr 05 '21 at 14:46

1 Answers1

0

Your second code block is correct if you set ratio = 10. I'm not sure where 4 comes from. Note that this will perform nearest neighbor matching without replacement, which means if there are not 10 control units for each treated unit, you will not be able to find matches for all treated units. To do nearest neighbor matching with replacement, set replace = TRUE.

Noah
  • 3,437
  • 1
  • 11
  • 27