-4

I am using the matchit package in R to match a data sample with treatment. The function is something like sales = price + location_zip. The prodcut has one other characteristics: category (ie., with numbers 1,2,3...). If I don't want to the matched control product in the same category (excluding matching within the same category), is there any good way to do it?

Thanks

Lernst
  • 13
  • 4
  • 2
    Your question will be closed unless you post a [MCVE] of you problem. Please read [How to make a great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) to learn how to ask a good question that gets helpful answers – divibisan Aug 14 '18 at 18:01

1 Answers1

0

There is no easy way to exclude pairs in MatchIt package based on custom condition. However you can use Matching package and impose the exclusion restriction as below:

Exclusion restriction are even more common. For example, if we want to exclude the observation pair 4 and 20 and the pair 6 and 55 from being matched, the restrict matrix would be: restrict=rbind(c(4,20,-1),c(6,55,-1))

Artem
  • 3,304
  • 3
  • 18
  • 41