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:
Remove the observations from the same year and company, however, removing the observations might lead to bias results and ruined the study.
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!
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()
.