0

I am trying to use MatchIt to perform Propensity Score Matching (PSM) for my panel data. The data is panel data that contains multi-year observations from the same group of companies.

The data is basically describing a list of bond data and the financial data of their issuers, also the bond terms such as issued date, coupon rate, maturity, and bond type of bonds issued by them. For instance:

Firmnames Year ROA Bond_type
AAPL US Equity 2015 0.3 0
AAPL US Equity 2015 0.3 1
AAPL US Equity 2016 0.3 0
AAPL US Equity 2017 0.3 0
C US Equity 2015 0.3 0
C US Equity 2016 0.3 0
C US Equity 2017 0.3 0

......

I've already known how to match the observations by the criteria I want and I use exact = Year to make sure I match observations from the same year. The problem now I am facing is that the observations from the same companies will be matched together, this is not what I want. The code I used:

matchit(Bond_type ~ Year + Amount_Issued + Cpn + Total_Assets_bf + AssetsEquityRatio_bf + Asset_Turnover_bf, data = rdata, method = "nearest", distance = "glm", exact = "Year")

However, as you can see, in the second raw of my sample, there might be two observations in one year from the same companies due to the nature of my study (the company can issue bonds more than one time a year). The only difference between them is the Bond_type. Therefore, the MathcIt function will, of course, treat them as the best control and treatment group and match these two observations together since they have the same ROA and other matching factors in that year.

I have two ways to solve this in my opinion:

  1. Remove the observations from the same year and company, however, removing the observations might lead to bias results and ruined the study.

  2. Preventing MatchIt function match the observations from the same company (or with the same Frimnames)

The second approach will be better since it will not lead to bias, however, I don't know if I can do this in MatchIt function. Hope someone can give me some advice on this or maybe there's any better solution to this problem, please be so kind to share with me, thanks in advance!

Note: If there's any further information or requirement I should provide, please just inform me. This is my first time raising the question here!

1 Answer 1

0

This is not possible with MatchIt at the moment (though it's an interesting idea and not hard to implement, so I may add it as a feature).

In the optmatch package, which perfroms optimal pair and full matching, there is a constraint that can be added called "anti-exact matching", which sounds exactly like what you want. Units with the same value of the anti-exact matching variable will not be matched with each other. This can be implemented using optmatch::antiExactMatch().

In the Matching package, which performs nearest neighbor and genetic matching, the restrict argument can be supplied to the matching function to restrict certain matches. You could manually create the restriction matrix by restricting all pairs of observations in the same company and then supply the matrix to Match().

5
  • Hello Noah, please understand your reply means the world to me. I will definitely try the package you've mentioned above. May I ask the following question, that is, which package will be the most suitable for me if I want to perform nearest- neighbor approach? The method I applied in my research requires it, so I am wondering that should I use optmatch or Matching to do this. I have only limited experience in R programming (2 months) and I will need some more time to learn a new package, so I better choose one that best fits my need. Mar 12, 2021 at 2:49
  • Optimal matching and NN matching w/o replacement are essentially the same thing. optmatch is easier to use and gives you access to full matching (which is an even better method) but may be slow with large datasets (> 100000 rows). Matching is a bit harder to use but has more options for customization and gives access to genetic matching, which is also a great method, and matching with replacement. It will be faster for larger datasets. If you ask questions on here I can help you use them for your purposes.
    – Noah
    Mar 12, 2021 at 13:22
  • Hi Noah. THANK YOU again for answering my detailed questions. I will try optmatich since my dataset is way below 100000 rows. If I encounter any further issues I will raise my questions again, and hopefully, get your helpful and detailed answers. Mar 16, 2021 at 1:44
  • Glad I was helpful. Feel free to mark this answer as selected so the question isn't lingering. BTW, I decided to add this feature to MatchIt, so it should appear in the next release.
    – Noah
    Mar 16, 2021 at 6:33
  • No probs I will do that immediately. May I ask that when will the latest version of MatchIt' will be released? Thanks again for your kindness. Mar 19, 2021 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.